summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjenglish <jenglish@flightlab.com>2008-05-23 17:58:32 (GMT)
committerjenglish <jenglish@flightlab.com>2008-05-23 17:58:32 (GMT)
commit2652f3815730b047a1d7a1b8be97accec9da4d85 (patch)
tree4ce769399309335ade9178524d71a694904d46dd
parent2cef89254b6055b551abf622fe895276984a59ec (diff)
downloadtk-2652f3815730b047a1d7a1b8be97accec9da4d85.zip
tk-2652f3815730b047a1d7a1b8be97accec9da4d85.tar.gz
tk-2652f3815730b047a1d7a1b8be97accec9da4d85.tar.bz2
Avoid passing width or height <= 0 to Tk_RedrawImage,
as this leads to a panic on Windows [Bug 1967576]
-rw-r--r--ChangeLog6
-rw-r--r--generic/ttk/ttkLabel.c8
2 files changed, 13 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index f7cd6a5..1468ecc 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-16 Pat Thoyts <patthoyts@users.sourceforge.net>
* library/ttk/xpTheme.tcl: Add correct border to combobox on Vista
@@ -28,6 +33,7 @@
* doc/ttk_*: 'identify' widget command is on all ttk widgets.
+>>>>>>> 1.1929
2008-05-04 Joe English <jenglish@users.sourceforge.net>
* macosx/ttkMacOSAquaTheme.c: "default" and "focus" adornments
diff --git a/generic/ttk/ttkLabel.c b/generic/ttk/ttkLabel.c
index a95e305..3c7902e 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.12 2008/05/23 17:58:33 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,