Skip to content

Commit

Permalink
Add a check to pngimage.c
Browse files Browse the repository at this point in the history
Check the result of png_get_IHDR inside the compare_read function.

Contributed-by: Kleber Tarcísio
Signed-off-by: Cosmin Truta
  • Loading branch information
klebertarcisio authored and ctruta committed Mar 13, 2021
1 parent e2bb5e7 commit 2224c8e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions contrib/libtests/pngimage.c
Expand Up @@ -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",\
Expand Down

0 comments on commit 2224c8e

Please sign in to comment.