summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorrmax <rmax>2007-09-11 18:05:03 (GMT)
committerrmax <rmax>2007-09-11 18:05:03 (GMT)
commit37983240fc7890cf83fdc1780090f668d1e472b6 (patch)
tree8328fbb356381b101c3a679d3faa8a0e92af1251 /tests
parent89022786e10d8bd3a7eb44f2053e1e31d6fcb0b0 (diff)
downloadtk-37983240fc7890cf83fdc1780090f668d1e472b6.zip
tk-37983240fc7890cf83fdc1780090f668d1e472b6.tar.gz
tk-37983240fc7890cf83fdc1780090f668d1e472b6.tar.bz2
* generic/tkImgGIF.c: Fixed a buffer overrun that got triggered by
multi-frame interlaced GIFs that contain subsequent frames that are smaller than the first one. * tests/imgPhoto.test: Added a test for the above.
Diffstat (limited to 'tests')
-rw-r--r--tests/imgPhoto.test14
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/imgPhoto.test b/tests/imgPhoto.test
index 3f1af80..4ab922e 100644
--- a/tests/imgPhoto.test
+++ b/tests/imgPhoto.test
@@ -9,7 +9,7 @@
#
# Author: Paul Mackerras (paulus@cs.anu.edu.au)
#
-# RCS: @(#) $Id: imgPhoto.test,v 1.25 2007/05/16 18:10:35 dgp Exp $
+# RCS: @(#) $Id: imgPhoto.test,v 1.26 2007/09/11 18:05:04 rmax Exp $
package require tcltest 2.1
eval tcltest::configure $argv
@@ -653,6 +653,18 @@ test imgPhoto-14.2 {GIF -index handler buffer sizing} -setup {
image delete $i
} -returnCodes error -result {no image data for this index}
+test imgPhoto-14.3 {GIF -index interleaving and small frames} -setup {
+ set i [image create photo]
+} -body {
+ # Interleaved GIFs used to crash us when a smaller subsequent frame
+ # was accessed.
+ $i configure -format {GIF -index 1} -data {
+ R0lGODdhAQAFAPAAAP8AAAAAACwAAAAAAQAFAEACAoRdACwAAAAAAQAEAEACAoRRADs=
+ }
+} -cleanup {
+ image delete $i
+}
+
test imgPhoto-15.1 {photo images can fail to allocate memory gracefully} \
{nonPortable} {
# This is not portable to very large machines with more around