summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tkImgGIF.c4
-rw-r--r--generic/tkImgPhoto.c6
2 files changed, 5 insertions, 5 deletions
diff --git a/generic/tkImgGIF.c b/generic/tkImgGIF.c
index fbfe621..1c28b54 100644
--- a/generic/tkImgGIF.c
+++ b/generic/tkImgGIF.c
@@ -593,7 +593,7 @@ FileReadGIF(
*/
if (trashBuffer == NULL) {
- if (fileWidth > (UINT_MAX/3)/fileHeight) {
+ if (fileWidth > (int)((UINT_MAX/3)/fileHeight)) {
goto error;
}
nBytes = fileWidth * fileHeight * 3;
@@ -688,7 +688,7 @@ FileReadGIF(
goto error;
}
block.pitch = block.pixelSize * imageWidth;
- if (imageHeight > UINT_MAX/block.pitch) {
+ if (imageHeight > (int)(UINT_MAX/block.pitch)) {
goto error;
}
nBytes = block.pitch * imageHeight;
diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c
index 7fa894c..3e03f3d 100644
--- a/generic/tkImgPhoto.c
+++ b/generic/tkImgPhoto.c
@@ -891,7 +891,7 @@ ImgPhotoCmd(
* May not be able to trigger/ demo / test this.
*/
- if (dataWidth > (UINT_MAX/3) / dataHeight) {
+ if (dataWidth > (int)((UINT_MAX/3) / dataHeight)) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"photo image dimensions exceed Tcl memory limits", -1));
Tcl_SetErrorCode(interp, "TK", "IMAGE", "PHOTO",
@@ -2223,7 +2223,7 @@ ImgPhotoSetSize(
|| (masterPtr->pix32 == NULL)) {
unsigned newPixSize;
- if (pitch && height > UINT_MAX / pitch) {
+ if (pitch && height > (int)(UINT_MAX / pitch)) {
return TCL_ERROR;
}
newPixSize = height * pitch;
@@ -3721,7 +3721,7 @@ ImgGetPhoto(
newPixelSize += 2;
}
- if (blockPtr->height > (UINT_MAX/newPixelSize)/blockPtr->width) {
+ if (blockPtr->height > (int)((UINT_MAX/newPixelSize)/blockPtr->width)) {
return NULL;
}
data = attemptckalloc(newPixelSize*blockPtr->width*blockPtr->height);