diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-02-11 14:53:51 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-02-11 14:53:51 (GMT) |
commit | 17a2a32f5d8320a600f7c686251597cef4705b9a (patch) | |
tree | 92ef7a44de098c4922e5751434b8301766b34e07 | |
parent | fcecdfffab24f3b6bf3d044ed7a50ea200dee5bb (diff) | |
download | tk-17a2a32f5d8320a600f7c686251597cef4705b9a.zip tk-17a2a32f5d8320a600f7c686251597cef4705b9a.tar.gz tk-17a2a32f5d8320a600f7c686251597cef4705b9a.tar.bz2 |
Fix [e331bc4708]: memset(NULL, …) called in Tk_PhotoBlank()
-rw-r--r-- | generic/tkImgPhoto.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c index 95350f4..d385a7c 100644 --- a/generic/tkImgPhoto.c +++ b/generic/tkImgPhoto.c @@ -3616,8 +3616,10 @@ Tk_PhotoBlank( * arrays for each instance. */ - memset(modelPtr->pix32, 0, - ((size_t)modelPtr->width * modelPtr->height * 4)); + if (modelPtr->pix32) { + memset(modelPtr->pix32, 0, + ((size_t)modelPtr->width * modelPtr->height * 4)); + } for (instancePtr = modelPtr->instancePtr; instancePtr != NULL; instancePtr = instancePtr->nextPtr) { TkImgResetDither(instancePtr); |