summaryrefslogtreecommitdiff
path: root/pngpread.c
diff options
context:
space:
mode:
authorTimothy Nikkel <tnikkel@gmail.com>2016-05-29 09:31:48 -0500
committerGlenn Randers-Pehrson <glennrp at users.sourceforge.net>2016-05-29 09:44:04 -0500
commit3f46c67c6989f480bd932428aa1705f6625dbabf (patch)
tree58ff84959b6e3bdaf53147120d9e9c3c29f1aaeb /pngpread.c
parent6c7459e455a4f7d95c7700e9326bb12396e6eb1f (diff)
[libpng16] Fixed the progressive reader to handle empty first IDAT chunk
properly (patch by Timothy Nikkel).
Diffstat (limited to 'pngpread.c')
-rw-r--r--pngpread.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/pngpread.c b/pngpread.c
index 0dc1e53c2..2e0208813 100644
--- a/pngpread.c
+++ b/pngpread.c
@@ -1,8 +1,8 @@
/* pngpread.c - read a png file in push mode
*
- * Last changed in libpng 1.6.18 [July 23, 2015]
- * Copyright (c) 1998-2002,2004,2006-2015 Glenn Randers-Pehrson
+ * Last changed in libpng 1.6.23 [(PENDING RELEASE)]
+ * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@@ -210,12 +210,14 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
(png_ptr->mode & PNG_HAVE_PLTE) == 0)
png_error(png_ptr, "Missing PLTE before IDAT");
- png_ptr->mode |= PNG_HAVE_IDAT;
png_ptr->process_mode = PNG_READ_IDAT_MODE;
- if ((png_ptr->mode & PNG_HAVE_CHUNK_AFTER_IDAT) == 0)
- if (png_ptr->push_length == 0)
- return;
+ if ((png_ptr->mode & PNG_HAVE_IDAT) != 0)
+ if ((png_ptr->mode & PNG_HAVE_CHUNK_AFTER_IDAT) == 0)
+ if (png_ptr->push_length == 0)
+ return;
+
+ png_ptr->mode |= PNG_HAVE_IDAT;
if ((png_ptr->mode & PNG_AFTER_IDAT) != 0)
png_benign_error(png_ptr, "Too many IDATs found");