From 8f300af691efb83b6f7db76bf5f6fe66cbce6f02 Mon Sep 17 00:00:00 2001 From: Eric Soroos Date: Sun, 8 Aug 2021 15:01:19 +0200 Subject: [PATCH] Actually check the framesize in FliDecode. --- src/libImaging/FliDecode.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libImaging/FliDecode.c b/src/libImaging/FliDecode.c index 3a6030703..f56432034 100644 --- a/src/libImaging/FliDecode.c +++ b/src/libImaging/FliDecode.c @@ -46,7 +46,8 @@ ImagingFliDecode(Imaging im, ImagingCodecState state, UINT8 *buf, Py_ssize_t byt ptr = buf; framesize = I32(ptr); - if (framesize < I32(ptr)) { + // there can be one pad byte in the framesize + if (bytes + (bytes % 2) < framesize) { return 0; }