]> git.sesse.net Git - x264/commitdiff
Timecode parsing: Add missing initialization
authorYusuke Nakamura <muken.the.vfrmaniac@gmail.com>
Fri, 29 Jul 2011 14:39:26 +0000 (23:39 +0900)
committerFiona Glaser <fiona@x264.com>
Fri, 29 Jul 2011 19:07:33 +0000 (12:07 -0700)
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

index 7767896d40df3d1e45275eaea0973c7de4e2b7bb..95d3f5b1fa4b0947da4c220555c01316d2eb7845 100644 (file)
@@ -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" )
     }