diff options
author | hobbs <hobbs> | 2000-06-03 08:38:11 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2000-06-03 08:38:11 (GMT) |
commit | 0ee9586f0c767f2ee5c742507a79d4199dbb99f4 (patch) | |
tree | 3bd012b1030fedff8233760d47a3190ca96ff263 /generic/tkCanvPoly.c | |
parent | 7fe91058e9d00893f6b9d3bdff0b8c0837d03482 (diff) | |
download | tk-0ee9586f0c767f2ee5c742507a79d4199dbb99f4.zip tk-0ee9586f0c767f2ee5c742507a79d4199dbb99f4.tar.gz tk-0ee9586f0c767f2ee5c742507a79d4199dbb99f4.tar.bz2 |
* canvas.test: added test for 5783.
* generic/tkCanvPoly.c (DisplayPolygon): added checks for the
polygon fillGC not being empty to prevent segfault. [Bug: 5783]
Diffstat (limited to 'generic/tkCanvPoly.c')
-rw-r--r-- | generic/tkCanvPoly.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/generic/tkCanvPoly.c b/generic/tkCanvPoly.c index 79ba527..3b6568e 100644 --- a/generic/tkCanvPoly.c +++ b/generic/tkCanvPoly.c @@ -5,11 +5,12 @@ * * Copyright (c) 1991-1994 The Regents of the University of California. * Copyright (c) 1994-1997 Sun Microsystems, Inc. + * Copyright (c) 1998-2000 Ajuba Solutions. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkCanvPoly.c,v 1.5 2000/02/01 11:41:09 hobbs Exp $ + * RCS: @(#) $Id: tkCanvPoly.c,v 1.6 2000/06/03 08:38:12 hobbs Exp $ */ #include <stdio.h> @@ -916,7 +917,7 @@ DisplayPolygon(canvas, itemPtr, display, drawable, x, y, width, height) * read-only. */ - if (stipple != None) { + if ((stipple != None) && (polyPtr->fillGC != None)) { Tk_TSOffset *tsoffset = &polyPtr->tsoffset; int w=0; int h=0; int flags = tsoffset->flags; @@ -991,7 +992,7 @@ DisplayPolygon(canvas, itemPtr, display, drawable, x, y, width, height) } } Tk_ResetOutlineGC(canvas, itemPtr, &(polyPtr->outline)); - if (stipple != None) { + if ((stipple != None) && (polyPtr->fillGC != None)) { XSetTSOrigin(display, polyPtr->fillGC, 0, 0); } } |