From: Yusuke Nakamura Date: Fri, 29 Jul 2011 14:39:26 +0000 (+0900) Subject: Timecode parsing: Add missing initialization X-Git-Url: http://www.zmx.ovh/git.videolan.org/?a=commitdiff_plain;h=e927cc334c74a3265e912bafaadb7009e44c27f8;p=x264.git Timecode parsing: Add missing initialization Fix crash when failed to parse timecode file before malloc pts. Fix detection of user timebase considered to be exceeding H.264 maximum. --- diff --git a/input/timecode.c b/input/timecode.c index 7767896d..95d3f5b1 100644 --- a/input/timecode.c +++ b/input/timecode.c @@ -342,11 +342,15 @@ static int open_file( char *psz_filename, hnd_t *p_handle, video_info_t *info, c FAIL_IF_ERROR( !h, "malloc failed\n" ) h->input = cli_input; h->p_handle = *p_handle; + h->pts = NULL; if( opt->timebase ) { ret = sscanf( opt->timebase, "%"SCNu64"/%"SCNu64, &h->timebase_num, &h->timebase_den ); if( ret == 1 ) + { h->timebase_num = strtoul( opt->timebase, NULL, 10 ); + h->timebase_den = 0; /* set later by auto timebase generation */ + } FAIL_IF_ERROR( h->timebase_num > UINT32_MAX || h->timebase_den > UINT32_MAX, "timebase you specified exceeds H.264 maximum\n" ) }