summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
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} {