]> granicus.if.org Git - imagemagick/commitdiff
Added "-define png:ignore-crc" option to PNG decoder
authorGlenn Randers-Pehrson <glennrp@gmail.com>
Wed, 2 Aug 2017 19:52:12 +0000 (15:52 -0400)
committerGlenn Randers-Pehrson <glennrp@gmail.com>
Wed, 2 Aug 2017 19:52:12 +0000 (15:52 -0400)
ChangeLog
coders/png.c

index 96803ec81454e9dc5382a6ef37692e711d210cbf..d737da833a09cc0073c8e24c0b71e9552916476a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,9 @@
     https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=32418).
   * Fix improper use of NULL in the JNG decoder (CVE-2017-11750, Reference
     https://github.com/ImageMagick/ImageMagick/issues/632).
+  * Added "-define png:ignore-crc" option to PNG decoder. When you know
+    your image has no CRC or ADLER32 errors, this can speed up decoding.
+    It is also helpful in debugging bug reports from "fuzzers".
 
 2017-07-29  7.0.6-5 Cristy  <quetzlzacatenango@image...>
   * Off by one error for gradient coder (reference
index e8e264f0ea259bcceef651e578bcb1a17d8a31d8..f9bea7f4cb821328a2084054e95aff154adb77c2 100644 (file)
@@ -2428,6 +2428,19 @@ static Image *ReadOnePNGImage(MngInfo *mng_info,
     const char
       *value;
 
+    value=GetImageOption(image_info,"png:ignore-crc");
+    if (value != NULL)
+    {
+       /* Turn off CRC checking while reading */
+       png_set_crc_action(ping, PNG_CRC_QUIET_USE, PNG_CRC_QUIET_USE);
+#ifdef PNG_IGNORE_ADLER32
+       /* Turn off ADLER32 checking while reading */
+       png_set_option(ping, PNG_IGNORE_ADLER32, PNG_OPTION_ON);
+#endif
+     }
+
+    ping_preserve_iCCP=MagickTrue;
+
     value=GetImageOption(image_info,"profile:skip");
 
     if (IsOptionMember("ICC",value) == MagickFalse)