summaryrefslogtreecommitdiffstats
path: root/generic/tkImgPhoto.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2022-02-11 14:53:51 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2022-02-11 14:53:51 (GMT)
commit17a2a32f5d8320a600f7c686251597cef4705b9a (patch)
tree92ef7a44de098c4922e5751434b8301766b34e07 /generic/tkImgPhoto.c
parentfcecdfffab24f3b6bf3d044ed7a50ea200dee5bb (diff)
downloadtk-17a2a32f5d8320a600f7c686251597cef4705b9a.zip
tk-17a2a32f5d8320a600f7c686251597cef4705b9a.tar.gz
tk-17a2a32f5d8320a600f7c686251597cef4705b9a.tar.bz2
Fix [e331bc4708]: memset(NULL, …) called in Tk_PhotoBlank()
Diffstat (limited to 'generic/tkImgPhoto.c')
-rw-r--r--generic/tkImgPhoto.c6
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);