summaryrefslogtreecommitdiff
path: root/pngread.c
diff options
context:
space:
mode:
authorJohn Bowler <jbowler@acm.org>2011-02-12 08:56:40 -0600
committerGlenn Randers-Pehrson <glennrp@shaggy.simplesystems.org>2011-02-12 08:56:40 -0600
commit6a6d79fc00c242eeca23ffdf40d64367b13ecd2a (patch)
tree8e532e38ebc6868d05e0942b70fa65603cf0d9cf /pngread.c
parentc83d421d9e038bea2e2266f0b5c0f0a8c7477f8a (diff)
downloadlibpng-6a6d79fc00c242eeca23ffdf40d64367b13ecd2a.tar.gz
[devel] turn on interlace handling in png_read_png
Diffstat (limited to 'pngread.c')
-rw-r--r--pngread.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/pngread.c b/pngread.c
index 8bc67d978..2e365cd8d 100644
--- a/pngread.c
+++ b/pngread.c
@@ -1311,7 +1311,7 @@ png_read_png(png_structp png_ptr, png_infop info_ptr,
{
int row;
- if (png_ptr == NULL)
+ if (png_ptr == NULL || info_ptr == NULL)
return;
/* png_read_info() gives us all of the information from the
@@ -1426,6 +1426,11 @@ png_read_png(png_structp png_ptr, png_infop info_ptr,
/* We don't handle adding filler bytes */
+ /* We use png_read_image and rely on that for interlace handling, but we also
+ * call png_read_update_info therefore must turn on interlace handling now:
+ */
+ (void)png_set_interlace_handling(png_ptr);
+
/* Optional call to gamma correct and add the background to the palette
* and update info structure. REQUIRED if you are expecting libpng to
* update the palette for you (i.e., you selected such a transform above).