add check for positive xsize/ysize in ImagingFliDecode

This commit is contained in:
Yay295 2024-09-23 02:00:44 -05:00 committed by GitHub
parent 731bcda904
commit cf4fe7f68b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -62,6 +62,10 @@ ImagingFliDecode(Imaging im, ImagingCodecState state, UINT8 *buf, Py_ssize_t byt
state->errcode = IMAGING_CODEC_UNKNOWN;
return -1;
}
if (state->xsize <= 0 || state->ysize <= 0) {
state->errcode = IMAGING_CODEC_CONFIG;
return -1;
}
chunks = I16(ptr + 6);
ptr += 16;