Skip to content

Commit fc65e43

Browse files
committed
Prevent division by zero
1 parent 7e6e08e commit fc65e43

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libImaging/FliDecode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ ImagingFliDecode(Imaging im, ImagingCodecState state, UINT8 *buf, Py_ssize_t byt
224224
break;
225225
case 16:
226226
/* COPY chunk */
227-
if (INT32_MAX / state->xsize < state->ysize) {
227+
if (INT32_MAX < (uint64_t)state->xsize * state->ysize) {
228228
/* Integer overflow, bail */
229229
state->errcode = IMAGING_CODEC_OVERRUN;
230230
return -1;

0 commit comments

Comments
 (0)