From 2224c8ea7b901ba038fdeff13605a60563bd00d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kleber=20Tarc=C3=ADsio?= Date: Tue, 28 Jul 2020 09:17:27 -0300 Subject: Add a check to pngimage.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Check the result of png_get_IHDR inside the compare_read function. Contributed-by: Kleber TarcĂ­sio Signed-off-by: Cosmin Truta --- contrib/libtests/pngimage.c | 5 +++-- 1 file 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",\ -- cgit v1.2.1