summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjenglish <jenglish@flightlab.com>2008-05-23 17:58:05 (GMT)
committerjenglish <jenglish@flightlab.com>2008-05-23 17:58:05 (GMT)
commit99711959d9accff6ee22ce2c51641def03871fce (patch)
tree36a445930bc1120590c90e3563f67cce0d40a5a7
parent4ae9901aa2f631ac42deb3d94991a0ab9ec51664 (diff)
downloadtk-99711959d9accff6ee22ce2c51641def03871fce.zip
tk-99711959d9accff6ee22ce2c51641def03871fce.tar.gz
tk-99711959d9accff6ee22ce2c51641def03871fce.tar.bz2
Avoid passing width or height <= 0 to Tk_RedrawImage,
as this leads to a panic on Windows [Bug 1967576]
-rw-r--r--ChangeLog5
-rw-r--r--generic/ttk/ttkLabel.c8
2 files changed, 12 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index db99f69..99f91be 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-05-23 Joe English <jenglish@users.sourceforge.net>
+
+ * generic/ttk/ttkLabel.c: Avoid passing width or height <= 0 to
+ Tk_RedrawImage, as this leads to a panic on Windows [Bug 1967576]
+
2008-05-11 Pat Thoyts <patthoyts@users.sourceforge.net>
* library/tk.tcl: Support for ttk widgets in AmpWidget
diff --git a/generic/ttk/ttkLabel.c b/generic/ttk/ttkLabel.c
index a95e305..ffc7928 100644
--- a/generic/ttk/ttkLabel.c
+++ b/generic/ttk/ttkLabel.c
@@ -1,4 +1,4 @@
-/* $Id: ttkLabel.c,v 1.11 2007/12/13 15:26:26 dgp Exp $
+/* $Id: ttkLabel.c,v 1.11.2.1 2008/05/23 17:58:08 jenglish Exp $
*
* text, image, and label elements.
*
@@ -314,6 +314,12 @@ static void ImageDraw(
height = Tk_Height(tkwin) - b.y;
}
+ if (height <= 0 || width <= 0) {
+ /* Completely clipped - bail out.
+ */
+ return;
+ }
+
Tk_RedrawImage(image->tkimg, 0,0, width, height, d, b.x, b.y);
/* If we're disabled there's no state-specific 'disabled' image,