Merge pull request #8408 from radarhere/fli

This commit is contained in:
Hugo van Kemenade 2024-09-30 14:50:54 +03:00 committed by GitHub
commit 0314bb3331
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -224,7 +224,7 @@ ImagingFliDecode(Imaging im, ImagingCodecState state, UINT8 *buf, Py_ssize_t byt
break; break;
case 16: case 16:
/* COPY chunk */ /* COPY chunk */
if (INT32_MAX / state->xsize < state->ysize) { if (INT32_MAX < (uint64_t)state->xsize * state->ysize) {
/* Integer overflow, bail */ /* Integer overflow, bail */
state->errcode = IMAGING_CODEC_OVERRUN; state->errcode = IMAGING_CODEC_OVERRUN;
return -1; return -1;