From: Anton Mitrofanov Date: Fri, 11 Nov 2011 19:19:02 +0000 (+0400) Subject: Fix crash if timecode file opening fails X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=2ecbcd73d60d2f749696b39627c91e28a396538b;p=x264 Fix crash if timecode file opening fails --- diff --git a/input/timecode.c b/input/timecode.c index cfec6c90..143304e5 100644 --- a/input/timecode.c +++ b/input/timecode.c @@ -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; }