summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2018-07-28 11:58:59 (GMT)
committerfvogel <fvogelnew1@free.fr>2018-07-28 11:58:59 (GMT)
commit93d974c265533cf2445446954346be8192e850a0 (patch)
tree86e2aefd9618b66b586d33732fb31edbf1f007df /tests
parentb2326c6455cbaac9f136f504622c5a35fa9dbb44 (diff)
downloadtk-93d974c265533cf2445446954346be8192e850a0.zip
tk-93d974c265533cf2445446954346be8192e850a0.tar.gz
tk-93d974c265533cf2445446954346be8192e850a0.tar.bz2
Fix [fbaed1f66b]: [image create photo] errors out on a sane animated gif. Cherrypicked [95f4a8e283]
Diffstat (limited to 'tests')
-rw-r--r--tests/deferredClearCode.gifbin0 -> 23355 bytes
-rw-r--r--tests/imgPhoto.test10
2 files changed, 10 insertions, 0 deletions
diff --git a/tests/deferredClearCode.gif b/tests/deferredClearCode.gif
new file mode 100644
index 0000000..d530618
--- /dev/null
+++ b/tests/deferredClearCode.gif
Binary files differ
diff --git a/tests/imgPhoto.test b/tests/imgPhoto.test
index cf25d6a..2b5f7ec 100644
--- a/tests/imgPhoto.test
+++ b/tests/imgPhoto.test
@@ -716,6 +716,16 @@ 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 animated GIF "deferredClearCode.gif" 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. The effect was that the GIF decoder bailed out before the end of the
+ # image reading, and produced the inappropriate "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} \
{nonPortable} {