[libpng16] Revert ADLER32 error handling in pngrutil.c and pngpread.c.

Change-Id: If8bd77a3fea39c6a8e33daca8d61c8d43a5fb77c
Signed-off-by: Alex Naidis <alex.naidis@linux.com>
diff --git a/README.android b/README.android
index f6062c6..32fb665 100644
--- a/README.android
+++ b/README.android
@@ -21,3 +21,7 @@
     in contrib/intel/intel_sse.patch.
     The patch was applied using the following command:
     'patch -i contrib/intel/intel_sse.patch -p1'
+
+(5) Revert ADLER32 error handling to fix the infinite loop
+Cherry picked from upstream:
+https://github.com/glennrp/libpng/commit/d65a92b951079d315e17e20ba9e7b8423d19397e
diff --git a/pngpread.c b/pngpread.c
index 650ba1e..794352f 100644
--- a/pngpread.c
+++ b/pngpread.c
@@ -684,12 +684,7 @@
             png_warning(png_ptr, "Truncated compressed data in IDAT");
 
          else
-         {
-            if (ret == Z_DATA_ERROR)
-               png_benign_error(png_ptr, "IDAT: ADLER32 checksum mismatch");
-            else
-               png_error(png_ptr, "Decompression error in IDAT");
-         }
+            png_error(png_ptr, "Decompression error in IDAT");
 
          /* Skip the check on unprocessed input */
          return;
diff --git a/pngrutil.c b/pngrutil.c
index fb5f5f0..3390367 100644
--- a/pngrutil.c
+++ b/pngrutil.c
@@ -4107,15 +4107,7 @@
          png_zstream_error(png_ptr, ret);
 
          if (output != NULL)
-         {
-            if(!strncmp(png_ptr->zstream.msg,"incorrect data check",20))
-            {
-               png_chunk_benign_error(png_ptr, "ADLER32 checksum mismatch");
-               continue;
-            }
-            else
-               png_chunk_error(png_ptr, png_ptr->zstream.msg);
-         }
+            png_chunk_error(png_ptr, png_ptr->zstream.msg);
 
          else /* checking */
          {