]> granicus.if.org Git - imagemagick/commitdiff
Handle benign errors as warnings in the PNG coder.
authorglennrp <glennrp@git.imagemagick.org>
Wed, 17 Apr 2013 12:58:15 +0000 (12:58 +0000)
committerglennrp <glennrp@git.imagemagick.org>
Wed, 17 Apr 2013 12:58:15 +0000 (12:58 +0000)
coders/png.c

index 26f282d543dbb710ac13fabe6cbe4eb08344d1f6..686a4cc2980217e8be03212c0ff53ff08d2e4a29 100644 (file)
@@ -2310,6 +2310,11 @@ static Image *ReadOnePNGImage(MngInfo *mng_info,
   LockSemaphoreInfo(ping_semaphore);
 #endif
 
+#if PNG_LIBPNG_VER >= 10400
+  /* Allow benign errors */
+  png_set_benign_errors(ping, 1);
+#endif
+
   /*
     Prepare PNG for reading.
   */
@@ -9321,6 +9326,11 @@ static MagickBooleanType WriteOnePNGImage(MngInfo *mng_info,
   LockSemaphoreInfo(ping_semaphore);
 #endif
 
+#if PNG_LIBPNG_VER >= 10400
+  /* Allow benign errors */
+  png_set_benign_errors(ping, 1);
+#endif
+
   /*
     Prepare PNG for writing.
   */