changeset 36558:33a385204875

aviheader: Close file also when an index file contains an error.
author reimar
date Sun, 19 Jan 2014 22:24:50 +0000
parents 7bfdbba6f2f7
children 85b5f38299fb
files libmpdemux/aviheader.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/aviheader.c	Sun Jan 19 22:24:49 2014 +0000
+++ b/libmpdemux/aviheader.c	Sun Jan 19 22:24:50 2014 +0000
@@ -629,10 +629,10 @@
       goto gen_index;
     }
   }
-  fclose(fp);
   mp_msg(MSGT_HEADER,MSGL_INFO, MSGTR_MPDEMUX_AVIHDR_IdxFileLoaded, index_file_load);
+gen_index:
+  if (fp) fclose(fp);
 }
-gen_index:
 if(index_mode>=2 || (priv->idx_size==0 && index_mode==1)){
   int idx_pos = 0;
   // build index for file: