[x264-devel] avs: Fix file handle leak

Henrik Gramner git at videolan.org
Sun Jul 26 22:26:30 CEST 2015


x264 | branch: master | Henrik Gramner <henrik at gramner.com> | Wed Jun 24 01:23:35 2015 +0200| [3533520655ef095ef009af9b6b27a20b45fd13ee] | committer: Anton Mitrofanov

avs: Fix file handle leak

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

 input/avs.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/input/avs.c b/input/avs.c
index d693dd4..3e4c8e5 100644
--- a/input/avs.c
+++ b/input/avs.c
@@ -175,8 +175,9 @@ static int open_file( char *psz_filename, hnd_t *p_handle, video_info_t *info, c
     FILE *fh = x264_fopen( psz_filename, "r" );
     if( !fh )
         return -1;
-    FAIL_IF_ERROR( !x264_is_regular_file( fh ), "AVS input is incompatible with non-regular file `%s'\n", psz_filename );
+    int b_regular = x264_is_regular_file( fh );
     fclose( fh );
+    FAIL_IF_ERROR( !b_regular, "AVS input is incompatible with non-regular file `%s'\n", psz_filename );
 
     avs_hnd_t *h = malloc( sizeof(avs_hnd_t) );
     if( !h )



More information about the x264-devel mailing list