]> git.sesse.net Git - x264/commitdiff
avs: Fix file handle leak
authorHenrik Gramner <henrik@gramner.com>
Tue, 23 Jun 2015 23:23:35 +0000 (01:23 +0200)
committerAnton Mitrofanov <BugMaster@narod.ru>
Fri, 24 Jul 2015 21:39:36 +0000 (00:39 +0300)
input/avs.c

index d693dd4622f7337fbaeefa99d1212858726db6f5..3e4c8e574012f2239746ab2afd9ccd45b70c352d 100644 (file)
@@ -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 )