Add bound check

Thanks to Floessie
(https://github.com/Beep6581/RawTherapee/pull/5889#discussion_r622755925)
This commit is contained in:
Lawrence Lee
2023-02-15 21:34:03 -08:00
parent bfe6e0fb85
commit 8704c1dd86

View File

@@ -650,13 +650,16 @@ public:
}
case FLOAT: {
union IntFloat {
std::uint32_t i;
float f;
} conv;
if (offset + 3 < tag->second.value.size()) {
union IntFloat {
std::uint32_t i;
float f;
} conv;
conv.i = sget4(tag->second.value.data() + offset);
return conv.f; // IEEE FLOATs are already C format, they just need a recast
conv.i = sget4(tag->second.value.data() + offset);
return conv.f; // IEEE FLOATs are already C format, they just need a recast
}
return 0.0;
}
default: {