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
This commit is contained in:
Kleber Tarcísio 2020-07-28 09:17:27 -03:00 committed by Cosmin Truta
parent e2bb5e7512
commit 2224c8ea7b

View File

@ -1006,8 +1006,9 @@ compare_read(struct display *dp, int applied_transforms)
int interlace_method, compression_method, filter_method; int interlace_method, compression_method, filter_method;
const char *e = NULL; const char *e = NULL;
png_get_IHDR(dp->read_pp, dp->read_ip, &width, &height, &bit_depth, if (!png_get_IHDR(dp->read_pp, dp->read_ip, &width, &height, &bit_depth,
&color_type, &interlace_method, &compression_method, &filter_method); &color_type, &interlace_method, &compression_method, &filter_method))
display_log(dp, LIBPNG_BUG, "png_get_IHDR failed");
# define C(item) if (item != dp->item) \ # define C(item) if (item != dp->item) \
display_log(dp, APP_WARNING, "IHDR " #item "(%lu) changed to %lu",\ display_log(dp, APP_WARNING, "IHDR " #item "(%lu) changed to %lu",\