summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2015-01-22 19:18:52 (GMT)
committerdgp <dgp@users.sourceforge.net>2015-01-22 19:18:52 (GMT)
commit57e8fb13bcd2a96f3d4eb84599dffc8d31cc5be4 (patch)
tree55baad001014d28a93b6b5aba4a6fa1b15e81da8
parent82a83e55c5f93ae3e6545f829f98c828fefa3c5b (diff)
downloadtk-57e8fb13bcd2a96f3d4eb84599dffc8d31cc5be4.zip
tk-57e8fb13bcd2a96f3d4eb84599dffc8d31cc5be4.tar.gz
tk-57e8fb13bcd2a96f3d4eb84599dffc8d31cc5be4.tar.bz2
Stop `make test` segfaults.
-rw-r--r--generic/tkTextDisp.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c
index 7422fd1..3c98178 100644
--- a/generic/tkTextDisp.c
+++ b/generic/tkTextDisp.c
@@ -3892,8 +3892,17 @@ RedisplayText(
{
register TkText *textPtr = (TkText *) clientData;
TextDInfo *dInfoPtr = textPtr->dInfoPtr;
- TkRegion damageRegion = TkCreateRegion();
- XRectangle rectangle = {0, 0, dInfoPtr->maxX, dInfoPtr->maxY};
+ TkRegion damageRegion;
+ XRectangle rectangle;
+
+ if (dInfoPtr == NULL) {
+ return;
+ }
+ damageRegion = TkCreateRegion();
+ rectangle.x = 0;
+ rectangle.y = 0;
+ rectangle.width = dInfoPtr->maxX;
+ rectangle.height = dInfoPtr->maxY;
TkUnionRectWithRegion(&rectangle, damageRegion, damageRegion);
TextInvalidateRegion(textPtr, damageRegion);