[MPlayer-cvslog] r35392 - trunk/libmpcodecs/vf_remove_logo.c

reimar subversion at mplayerhq.hu
Sat Nov 10 14:11:49 CET 2012


Author: reimar
Date: Sat Nov 10 14:11:49 2012
New Revision: 35392

Log:
Fix resource leaks when loading logo file in vf_remove_logo.

Modified:
   trunk/libmpcodecs/vf_remove_logo.c

Modified: trunk/libmpcodecs/vf_remove_logo.c
==============================================================================
--- trunk/libmpcodecs/vf_remove_logo.c	Sat Nov 10 14:06:15 2012	(r35391)
+++ trunk/libmpcodecs/vf_remove_logo.c	Sat Nov 10 14:11:49 2012	(r35392)
@@ -510,7 +510,7 @@ static void load_pgm_skip(FILE *f) {
   ungetc(c, f);
 }
 
-#define REMOVE_LOGO_LOAD_PGM_ERROR_MESSAGE(message) {mp_msg(MSGT_VFILTER, MSGL_ERR, message); return NULL;}
+#define REMOVE_LOGO_LOAD_PGM_ERROR_MESSAGE(message) {mp_msg(MSGT_VFILTER, MSGL_ERR, message); goto err_out;}
 
 /**
  * \brief Loads a raw pgm or ppm file into a newly created pgm_structure object.
@@ -568,8 +568,15 @@ static pgm_structure * load_pgm(const ch
       *write_position |= fgetc(input);
     }
   }
+  fclose(input);
 
   return new_pgm;
+
+err_out:
+  if (input)
+    fclose(input);
+  free(new_pgm);
+  return NULL;
 }
 
 /**


More information about the MPlayer-cvslog mailing list