Skip to content

Commit 9477634

Browse files
committedJan 21, 2023
Add test for Fax3 decoding issues (refs #513)
1 parent 8a4f6b5 commit 9477634

File tree

5 files changed

+27
-2
lines changed

5 files changed

+27
-2
lines changed
 

‎test/CMakeLists.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ set(TIFFIMAGES
4747
images/quad-lzw-compat.tiff
4848
images/lzw-single-strip.tiff
4949
images/testfax4.tiff
50-
images/testfax3_bug_513.tiff)
50+
images/testfax3_bug_513.tiff
51+
)
5152
# TIFF images using old-jpeg. Unused unless JPEG support is enabled.
5253
set(TIFFIMAGES_OJPEG)
5354

‎test/Makefile.am

+1-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ REFFILES = \
170170
refs/o-tiff2ps-PS2.ps \
171171
refs/o-tiff2ps-PS3.ps \
172172
refs/o-testfax4.tiff \
173-
refs/o-testfax3_bug_513.sh.tiff \
173+
refs/o-testfax3_bug_513.tiff \
174174
refs/o-deflate-last-strip-extra-data.tiff
175175

176176
# This list should contain all of the TIFF files in the 'images'

‎test/images/testfax3_bug_513.tiff

198 Bytes
Binary file not shown.

‎test/refs/o-testfax3_bug_513.tiff

154 Bytes
Binary file not shown.

‎test/testfax3_bug_513.sh

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/sh
2+
#
3+
# check decoding of a CCITT Group 3 encoded TIFF
4+
# hitting https://gitlab.com/libtiff/libtiff/-/issues/513
5+
. ${srcdir:-.}/common.sh
6+
infile="${IMAGES}/testfax3_bug_513.tiff"
7+
outfile="o-testfax3_bug_513.tiff"
8+
rm -f $outfile
9+
echo "$MEMCHECK ${TIFFCP} -c none $infile $outfile"
10+
eval "$MEMCHECK ${TIFFCP} -c none $infile $outfile"
11+
status=$?
12+
if [ $status != 0 ] ; then
13+
echo "Returned failed status $status!"
14+
echo "Output (if any) is in \"${outfile}\"."
15+
exit $status
16+
fi
17+
echo "$MEMCHECK ${TIFFCMP} $outfile ${REFS}/$outfile"
18+
eval "$MEMCHECK ${TIFFCMP} $outfile ${REFS}/$outfile"
19+
status=$?
20+
if [ $status != 0 ] ; then
21+
echo "Returned failed status $status!"
22+
echo "\"${outfile}\" differs from reference file."
23+
exit $status
24+
fi

0 commit comments

Comments
 (0)
Please sign in to comment.