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

reimar subversion at mplayerhq.hu
Sun Apr 6 21:19:07 CEST 2014


Author: reimar
Date: Sun Apr  6 21:19:07 2014
New Revision: 37143

Log:
vf_remove_logo: sanity-check PGM width/height.

Modified:
   trunk/libmpcodecs/vf_remove_logo.c

Modified: trunk/libmpcodecs/vf_remove_logo.c
==============================================================================
--- trunk/libmpcodecs/vf_remove_logo.c	Sun Apr  6 21:16:01 2014	(r37142)
+++ trunk/libmpcodecs/vf_remove_logo.c	Sun Apr  6 21:19:07 2014	(r37143)
@@ -553,6 +553,9 @@ static pgm_structure * load_pgm(const ch
   if (maximum_greyscale_value >= 256) REMOVE_LOGO_LOAD_PGM_ERROR_MESSAGE("[vf]remove_logo: Only 1 byte per pixel (pgm) or 1 byte per color value (ppm) are supported.\n");
   load_pgm_skip(input);
 
+  if (new_pgm->width <= 0 || new_pgm->width > 0x7fff ||
+      new_pgm->height <= 0 || new_pgm->height > 0x7fff)
+    REMOVE_LOGO_LOAD_PGM_ERROR_MESSAGE("[vf]remove_logo: Invalid PGM dimensions.\n");
   image_size = new_pgm->width * new_pgm->height;
   new_pgm->pixel = safe_malloc (image_size);
 


More information about the MPlayer-cvslog mailing list