]> granicus.if.org Git - imagemagick/commitdiff
Prevent random pixel data for corrupt JPEG image
authorCristy <urban-warrior@imagemagick.org>
Wed, 15 Feb 2017 23:46:44 +0000 (18:46 -0500)
committerCristy <urban-warrior@imagemagick.org>
Wed, 15 Feb 2017 23:47:08 +0000 (18:47 -0500)
ChangeLog
coders/jpeg.c

index 7f643197bb452ad9c15f3ba5b1308b54bc84530d..b9ea93c09ad663a74e135b4c60bd4a3aecfa06ba 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2017-02-15  7.0.4-10 Cristy  <quetzlzacatenango@image...>
+  * Prevent random pixel data for corrupt JPEG image (bug report from
+    Hirokazu Moriguchi, Sony).
+
 2017-02-14  7.0.4-9 Cristy  <quetzlzacatenango@image...>
   * Release ImageMagick version 7.0.4-9, GIT revision 19580:d474b37:20170214.
 
index 966ec48651865decca083a6c4d7ff5fb4567697e..c53f10817e73ab44c83a8ff86b02212012d9913e 100644 (file)
@@ -359,10 +359,9 @@ static MagickBooleanType JPEGWarningHandler(j_common_ptr jpeg_info,int level)
         Process warning message.
       */
       (jpeg_info->err->format_message)(jpeg_info,message);
-      if (jpeg_info->err->num_warnings++ > JPEGExcessiveWarnings)
-        JPEGErrorHandler(jpeg_info);
-      ThrowBinaryException(CorruptImageWarning,(char *) message,
-        image->filename);
+      if (jpeg_info->err->num_warnings++ < JPEGExcessiveWarnings)
+        ThrowBinaryException(CorruptImageWarning,(char *) message,
+          image->filename);
     }
   else
     if ((image->debug != MagickFalse) &&