mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-15 06:07:33 +03:00
Prevent division by zero
This commit is contained in:
parent
7e6e08ea6a
commit
fc65e437cf
|
@ -224,7 +224,7 @@ ImagingFliDecode(Imaging im, ImagingCodecState state, UINT8 *buf, Py_ssize_t byt
|
|||
break;
|
||||
case 16:
|
||||
/* COPY chunk */
|
||||
if (INT32_MAX / state->xsize < state->ysize) {
|
||||
if (INT32_MAX < (uint64_t)state->xsize * state->ysize) {
|
||||
/* Integer overflow, bail */
|
||||
state->errcode = IMAGING_CODEC_OVERRUN;
|
||||
return -1;
|
||||
|
|
Loading…
Reference in New Issue
Block a user