From e927cc334c74a3265e912bafaadb7009e44c27f8 Mon Sep 17 00:00:00 2001 From: Yusuke Nakamura Date: Fri, 29 Jul 2011 23:39:26 +0900 Subject: [PATCH] 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. --- input/timecode.c | 4 ++++ 1 file changed, 4 insertions(+) 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" ) } -- 2.47.3