[x264-devel] Fix crash if timecode file opening fails

Anton Mitrofanov git at videolan.org
Tue Dec 6 01:00:43 CET 2011


x264 | branch: master | Anton Mitrofanov <BugMaster at narod.ru> | Fri Nov 11 23:19:02 2011 +0400| [e0c11dc6e283569606aaa97767401c6a13c2529d] | committer: Jason Garrett-Glaser

Fix crash if timecode file opening fails

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

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

diff --git a/input/timecode.c b/input/timecode.c
index cfec6c9..143304e 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;
 }
 



More information about the x264-devel mailing list