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' |
|------------------------------------------------------------------------------------------------------------------------|
This commit is contained in:
Mirco Miranda 2023-09-11 09:07:53 +00:00 committed by Albert Astals Cid
parent a981cefdd2
commit c3daf86079

View File

@ -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