summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2004-02-09 14:48:20 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2004-02-09 14:48:20 (GMT)
commit336606efeef781595867d3cd1a7a8c4cfd7c5996 (patch)
treeaa7e897ab43c04037776f13b81d9d07694de80a1 /tests
parentfefdd508a8ca659fee8e25f3d7e19e1e0e7d62d6 (diff)
downloadtk-336606efeef781595867d3cd1a7a8c4cfd7c5996.zip
tk-336606efeef781595867d3cd1a7a8c4cfd7c5996.tar.gz
tk-336606efeef781595867d3cd1a7a8c4cfd7c5996.tar.bz2
Stop crashes when copying a large photo to itself causes resizing. [Bug 877950]
Diffstat (limited to 'tests')
-rw-r--r--tests/imgPhoto.test10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/imgPhoto.test b/tests/imgPhoto.test
index 4a5eead..fe8228d 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.16 2003/04/01 21:06:37 dgp Exp $
+# RCS: @(#) $Id: imgPhoto.test,v 1.17 2004/02/09 14:48:20 dkf Exp $
package require tcltest 2.1
eval tcltest::configure $argv
@@ -655,6 +655,14 @@ test imgPhoto-15.1 {photo images can fail to allocate memory gracefully} \
list [catch {image create photo -width 32000 -height 32000} msg] $msg
} {1 {not enough free memory for image buffer}}
+test imgPhoto-16.1 {copying to self doesn't access freed memory} {
+ # Bug 877950 makes this crash when trying to copy out of a deallocated area
+ set photo [image create photo]
+ $i put red -to 0 0 1000 1000
+ $i copy $i -from 0 0 1000 1000 -to 500 0
+ image delete $i
+} {}
+
destroy .c
eval image delete [image names]