Skip to content

Commit 0f579c3

Browse files
committed
Cast int before potentially exceeding INT_MAX
1 parent 731bcda commit 0f579c3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libImaging/SgiRleDecode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ ImagingSgiRleDecode(Imaging im, ImagingCodecState state, UINT8 *buf, Py_ssize_t
183183
each with 4 bytes per element of tablen
184184
Check here before we allocate any memory
185185
*/
186-
if (c->bufsize < 8 * c->tablen) {
186+
if (c->bufsize < 8 * (uint64_t)c->tablen) {
187187
state->errcode = IMAGING_CODEC_OVERRUN;
188188
return -1;
189189
}

0 commit comments

Comments
 (0)