summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKleber Tarcísio <klebertarcisio@yahoo.com.br>2020-07-28 09:17:27 -0300
committerCosmin Truta <ctruta@gmail.com>2021-03-13 01:56:32 -0500
commit2224c8ea7b901ba038fdeff13605a60563bd00d2 (patch)
tree21e6908e68e777e1ae348d0cf39101d494cc5821
parente2bb5e7512a48dcfe191065decac9cf78a68fd12 (diff)
downloadlibpng-2224c8ea7b901ba038fdeff13605a60563bd00d2.tar.gz
Add a check to pngimage.c
Check the result of png_get_IHDR inside the compare_read function. Contributed-by: Kleber Tarcísio Signed-off-by: Cosmin Truta
-rw-r--r--contrib/libtests/pngimage.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/contrib/libtests/pngimage.c b/contrib/libtests/pngimage.c
index 1fe499aaa..be176b2bc 100644
--- a/contrib/libtests/pngimage.c
+++ b/contrib/libtests/pngimage.c
@@ -1006,8 +1006,9 @@ compare_read(struct display *dp, int applied_transforms)
int interlace_method, compression_method, filter_method;
const char *e = NULL;
- png_get_IHDR(dp->read_pp, dp->read_ip, &width, &height, &bit_depth,
- &color_type, &interlace_method, &compression_method, &filter_method);
+ if (!png_get_IHDR(dp->read_pp, dp->read_ip, &width, &height, &bit_depth,
+ &color_type, &interlace_method, &compression_method, &filter_method))
+ display_log(dp, LIBPNG_BUG, "png_get_IHDR failed");
# define C(item) if (item != dp->item) \
display_log(dp, APP_WARNING, "IHDR " #item "(%lu) changed to %lu",\