[x264-devel] Timecode parsing: Add missing initialization

Yusuke Nakamura git at videolan.org
Sat Jul 30 05:54:46 CEST 2011


x264 | branch: master | Yusuke Nakamura <muken.the.vfrmaniac at gmail.com> | Fri Jul 29 23:39:26 2011 +0900| [e927cc334c74a3265e912bafaadb7009e44c27f8] | committer: Jason Garrett-Glaser

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.

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=e927cc334c74a3265e912bafaadb7009e44c27f8
---

 input/timecode.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/input/timecode.c b/input/timecode.c
index 7767896..95d3f5b 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" )
     }



More information about the x264-devel mailing list