summaryrefslogtreecommitdiffstats
path: root/generic/tkImgPhoto.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2021-12-14 10:03:36 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2021-12-14 10:03:36 (GMT)
commitdbbe0a62aec26cbb25226ef18e9c77910f152efb (patch)
tree3f412f0584c6938ee17a614a9c4037ab000e8fe6 /generic/tkImgPhoto.c
parentbb83b0ea7139c1a9456d26bd11d139a5c76707eb (diff)
downloadtk-dbbe0a62aec26cbb25226ef18e9c77910f152efb.zip
tk-dbbe0a62aec26cbb25226ef18e9c77910f152efb.tar.gz
tk-dbbe0a62aec26cbb25226ef18e9c77910f152efb.tar.bz2
Fix [156e58bc6e]: Tk_PhotoPutBlock(), Tk_PhotoPutZoomedBlock(): undefined behavior, other possible issues?
Diffstat (limited to 'generic/tkImgPhoto.c')
-rw-r--r--generic/tkImgPhoto.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c
index 03c5c9e..2e1bb7b 100644
--- a/generic/tkImgPhoto.c
+++ b/generic/tkImgPhoto.c
@@ -2785,8 +2785,8 @@ Tk_PhotoPutBlock(
*/
sourceBlock = *blockPtr;
memToFree = NULL;
- if (sourceBlock.pixelPtr >= modelPtr->pix32
- && sourceBlock.pixelPtr <= modelPtr->pix32 + modelPtr->width
+ if (modelPtr->pix32 && (sourceBlock.pixelPtr >= modelPtr->pix32)
+ && (sourceBlock.pixelPtr < modelPtr->pix32 + modelPtr->width)
* modelPtr->height * 4) {
/*
* Fix 5c51be6411: avoid reading
@@ -3231,8 +3231,8 @@ Tk_PhotoPutZoomedBlock(
*/
sourceBlock = *blockPtr;
memToFree = NULL;
- if (sourceBlock.pixelPtr >= modelPtr->pix32
- && sourceBlock.pixelPtr <= modelPtr->pix32 + modelPtr->width
+ if (modelPtr->pix32 && (sourceBlock.pixelPtr >= modelPtr->pix32)
+ && (sourceBlock.pixelPtr < modelPtr->pix32 + modelPtr->width)
* modelPtr->height * 4) {
/*
* Fix 5c51be6411: avoid reading