[x264-devel] mp4: Fix file handle leak
Anton Mitrofanov
git at videolan.org
Sun Jul 26 22:26:30 CEST 2015
x264 | branch: master | Anton Mitrofanov <BugMaster at narod.ru> | Sat Jul 25 00:20:47 2015 +0300| [d6aa586b2f83eeb776744c2e97a8ce9e1181c59b] | committer: Anton Mitrofanov
mp4: Fix file handle leak
> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=d6aa586b2f83eeb776744c2e97a8ce9e1181c59b
---
output/mp4.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/output/mp4.c b/output/mp4.c
index 2cf81f5..c0af118 100644
--- a/output/mp4.c
+++ b/output/mp4.c
@@ -169,8 +169,9 @@ static int open_file( char *psz_filename, hnd_t *p_handle, cli_output_opt_t *opt
FILE *fh = x264_fopen( psz_filename, "w" );
if( !fh )
return -1;
- FAIL_IF_ERR( !x264_is_regular_file( fh ), "mp4", "MP4 output is incompatible with non-regular file `%s'\n", psz_filename )
+ int b_regular = x264_is_regular_file( fh );
fclose( fh );
+ FAIL_IF_ERR( !b_regular, "mp4", "MP4 output is incompatible with non-regular file `%s'\n", psz_filename )
mp4_hnd_t *p_mp4 = calloc( 1, sizeof(mp4_hnd_t) );
if( !p_mp4 )
More information about the x264-devel
mailing list