Fix crash if timecode file opening fails
authorAnton Mitrofanov <BugMaster@narod.ru>
Fri, 11 Nov 2011 19:19:02 +0000 (23:19 +0400)
committerJason Garrett-Glaser <jason@x264.com>
Fri, 11 Nov 2011 22:40:12 +0000 (14:40 -0800)
input/timecode.c

index cfec6c9..143304e 100644 (file)
@@ -368,8 +368,6 @@ static int open_file( char *psz_filename, hnd_t *p_handle, video_info_t *info, c
     timecode_input.picture_alloc = h->input.picture_alloc;
     timecode_input.picture_clean = h->input.picture_clean;
 
-    *p_handle = h;
-
     tcfile_in = fopen( psz_filename, "rb" );
     FAIL_IF_ERROR( !tcfile_in, "can't open `%s'\n", psz_filename )
     else if( !x264_is_regular_file( tcfile_in ) )
@@ -392,6 +390,7 @@ static int open_file( char *psz_filename, hnd_t *p_handle, video_info_t *info, c
     info->timebase_den = h->timebase_den;
     info->vfr = 1;
 
+    *p_handle = h;
     return 0;
 }