mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-14 21:56:56 +03:00
Cast int before potentially exceeding INT_MAX
This commit is contained in:
parent
7e6e08ea6a
commit
cc0b6b9de9
|
@ -183,7 +183,7 @@ ImagingSgiRleDecode(Imaging im, ImagingCodecState state, UINT8 *buf, Py_ssize_t
|
|||
each with 4 bytes per element of tablen
|
||||
Check here before we allocate any memory
|
||||
*/
|
||||
if (c->bufsize < 8 * c->tablen) {
|
||||
if (c->bufsize < 8 * (int64_t)c->tablen) {
|
||||
state->errcode = IMAGING_CODEC_OVERRUN;
|
||||
return -1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user