From c3daf8607979c038e23858232a1523301c8c150d Mon Sep 17 00:00:00 2001 From: Mirco Miranda Date: Mon, 11 Sep 2023 09:07:53 +0000 Subject: [PATCH] hdr: fix oss-fuzz issue 62197 Fixes the following error: | /src/kimageformats/src/imageformats/hdr.cpp:56:31: runtime error: shift exponent 32 is too large for 32-bit type 'int' | |------------------------------------------------------------------------------------------------------------------------| --- src/imageformats/hdr.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/imageformats/hdr.cpp b/src/imageformats/hdr.cpp index 6dca6eb..0f55f6d 100644 --- a/src/imageformats/hdr.cpp +++ b/src/imageformats/hdr.cpp @@ -53,6 +53,9 @@ static bool Read_Old_Line(uchar *image, int width, QDataStream &s) if ((image[0] == 1) && (image[1] == 1) && (image[2] == 1)) { // NOTE: we don't have an image sample that cover this code + if (rshift > 31) { + return false; + } for (i = image[3] << rshift; i > 0 && width > 0; i--) { if (image == start) { return false; // you cannot be here at the first run