diff options
author | pspjuth <pspjuth@noemail.net> | 2011-04-22 18:21:05 (GMT) |
---|---|---|
committer | pspjuth <pspjuth@noemail.net> | 2011-04-22 18:21:05 (GMT) |
commit | 64aaca3423cb67d7f45609c67ea53f8906caae62 (patch) | |
tree | 5bb443774b1c95de47d0ef87d86d34d6156cf862 | |
parent | 77c9fcecdb1280c53869456ac85409c09687c4f5 (diff) | |
parent | 7fbdff1f7728d42e5e6d592e0996183bf44a8ae3 (diff) | |
download | tk-64aaca3423cb67d7f45609c67ea53f8906caae62.zip tk-64aaca3423cb67d7f45609c67ea53f8906caae62.tar.gz tk-64aaca3423cb67d7f45609c67ea53f8906caae62.tar.bz2 |
[Bug 3291543] There was a crash if dchars removed all coordinates of a polygon.
FossilOrigin-Name: 7262cbf02c025fff0a5274b344e35ac0e335242f
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | generic/tkCanvPoly.c | 1 | ||||
-rw-r--r-- | tests/canvas.test | 8 |
3 files changed, 14 insertions, 0 deletions
@@ -1,3 +1,8 @@ +2011-04-22 Peter Spjuth <peter.spjuth@gmail.com> + + * generic/tkCanvPoly.c: [Bug 3291543] There was a crash if dchars + * tests/canvas.test: removed all coordinates of a polygon. + 2011-04-21 Peter Spjuth <peter.spjuth@gmail.com> * doc/checkbutton.n: Document all variable options as global. diff --git a/generic/tkCanvPoly.c b/generic/tkCanvPoly.c index 1e61367..92375b9 100644 --- a/generic/tkCanvPoly.c +++ b/generic/tkCanvPoly.c @@ -1200,6 +1200,7 @@ PolygonDeleteCoords( polyPtr->numPoints = 0; if (polyPtr->coordPtr != NULL) { ckfree((char *) polyPtr->coordPtr); + polyPtr->coordPtr = NULL; } ComputePolygonBbox(canvas, polyPtr); return; diff --git a/tests/canvas.test b/tests/canvas.test index f6a85fb..e05620b 100644 --- a/tests/canvas.test +++ b/tests/canvas.test @@ -405,6 +405,14 @@ test canvas-11.2 {canvas poly overlap fill check, bug 226357} -setup { .c itemconfig 1 -width 8 lappend result [.c find over 45 50 45 50]; # outside poly } -result {1 1 {} 1 {} 1 1 {} 1 {} 1} +test canvas-11.3 {canvas poly dchars, bug 3291543} { + # This would crash + destroy .c + pack [canvas .c] + .c create polygon 0 0 0 10 10 0 + .c dchars 1 2 end + .c coords 1 +} {} test canvas-12.1 {canvas mm obj, patch SF-403327, 102471} -setup { destroy .c |