summaryrefslogtreecommitdiffstats
path: root/tests/imgPhoto.test
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2018-07-21 15:09:23 (GMT)
committerfvogel <fvogelnew1@free.fr>2018-07-21 15:09:23 (GMT)
commit315f3c653f20811c037a8fd8c3ca063f494aa74b (patch)
treee46f5a74623491782eec8a1b6027d281409fa0e0 /tests/imgPhoto.test
parent4f2efa991ab55c68e41893d34cc30a6598fedf30 (diff)
downloadtk-315f3c653f20811c037a8fd8c3ca063f494aa74b.zip
tk-315f3c653f20811c037a8fd8c3ca063f494aa74b.tar.gz
tk-315f3c653f20811c037a8fd8c3ca063f494aa74b.tar.bz2
Add test imgPhoto-14.5 exercising the fix for [fbaed1f66b]. The GIF decoder didn't manage deferred clear code. This test passes with the fix [340cad7a] and fails before that fix.
Diffstat (limited to 'tests/imgPhoto.test')
-rw-r--r--tests/imgPhoto.test14
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/imgPhoto.test b/tests/imgPhoto.test
index 0126ad9..f00d8eb 100644
--- a/tests/imgPhoto.test
+++ b/tests/imgPhoto.test
@@ -1201,7 +1201,19 @@ test imgPhoto-14.4 {GIF buffer overflow} -setup {
} -cleanup {
image delete $i
} -returnCodes error -result {malformed image}
-
+test imgPhoto-14.5 {Bug [fbaed1f66b] - GIF decoder with deferred clear code} -setup {
+ set fileName [file join [file dirname [info script]] deferredClearCode.gif]
+} -body {
+ # This erroneously produced "malformed image" error.
+ # The deferredClearCode.gif image only has two frames, and calling for -index 2
+ # simply is an easy way to trigger the problem of improper management of a
+ # deferred clear code. It's easier to show the problem using a GIF image with
+ # several frames. With just a single frame, the effect is that the GIF decoder
+ # bailed out before the end of the image reading, which produces black pixels
+ # at the bottom of the image but no "malformed image error".
+ image create photo -file $fileName -format "gif -index 2"
+} -returnCodes error -result {no image data for this index}
+
test imgPhoto-15.1 {photo images can fail to allocate memory gracefully} -constraints {
nonPortable
} -body {