aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2016-01-13 23:04:51 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2016-01-13 23:04:51 +0000
commit0d1ef6789fec2438560d9e0a0d0c8b3455db3fb2 (patch)
tree9ed79ca9793743734bafca0d3c0975b64d1e9a6b
parent71f60161c4f84681dc253be76ebca9df319e3ad6 (diff)
parent017358c0b7f0f8610225b7b89027d168b485ae28 (diff)
downloadlibpng-0d1ef6789fec2438560d9e0a0d0c8b3455db3fb2.tar.gz
Merge "libpng: fix hang during read when inflate fails"
-rw-r--r--pngrutil.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/pngrutil.c b/pngrutil.c
index f78934807..580a2537c 100644
--- a/pngrutil.c
+++ b/pngrutil.c
@@ -4075,9 +4075,14 @@ png_read_IDAT_data(png_structrp png_ptr, png_bytep output,
break;
}
- if (ret != Z_OK)
+ if (ret != Z_OK) {
#ifdef PNG_INDEX_SUPPORTED
- if (png_ptr->index && png_ptr->row_number != png_ptr->height - 1)
+ if (png_ptr->index) {
+ if (png_ptr->row_number != png_ptr->height - 1) {
+ png_error(png_ptr, png_ptr->zstream.msg ?
+ png_ptr->zstream.msg : "Decompression error");
+ }
+ } else
#endif
{
png_zstream_error(png_ptr, ret);
@@ -4091,6 +4096,7 @@ png_read_IDAT_data(png_structrp png_ptr, png_bytep output,
return;
}
}
+ }
} while (avail_out > 0);
if (avail_out > 0)