From cf4fe7f68b916db36cc19c7cd5298aea67b22bd9 Mon Sep 17 00:00:00 2001 From: Yay295 Date: Mon, 23 Sep 2024 02:00:44 -0500 Subject: [PATCH] add check for positive xsize/ysize in ImagingFliDecode --- src/libImaging/FliDecode.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libImaging/FliDecode.c b/src/libImaging/FliDecode.c index 6b2518d35ce..957c0108fac 100644 --- a/src/libImaging/FliDecode.c +++ b/src/libImaging/FliDecode.c @@ -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;