Skip to content

Commit

Permalink
[libpng16] test: Add a compile-time check in pngimage.c to avoid a fa…
Browse files Browse the repository at this point in the history
…ilure

Disable the check on `interlace_method` inside function `compare_read`
in pngimage.c, if WRITE_INTERLACING is not supported.

If interlaced encoding is disabled inside libpng, the encoded images
are non-interlaced silently and unconditionally.  This commit updates
the image comparison to skip the interlace check in the resultant
image; other behavior is still checked.

This is a cherry-pick of commit d9f13d8
from branch 'libpng18'.

Reviewed-by: Cosmin Truta <ctruta@gmail.com>
Signed-off-by: John Bowler <jbowler@acm.org>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
  • Loading branch information
jbowler authored and ctruta committed Oct 15, 2024
1 parent 65470ac commit 76e5ec2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion contrib/libtests/pngimage.c
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,12 @@ compare_read(struct display *dp, int applied_transforms)
C(height);
C(bit_depth);
C(color_type);
C(interlace_method);
# ifdef PNG_WRITE_INTERLACING_SUPPORTED
/* If write interlace has been disabled, the PNG file is still
* written correctly, but as a regular (not-interlaced) PNG.
*/
C(interlace_method);
# endif
C(compression_method);
C(filter_method);

Expand Down

0 comments on commit 76e5ec2

Please sign in to comment.