mirror of
https://invent.kde.org/frameworks/kimageformats.git
synced 2025-07-18 03:54:18 -04:00
ras: tweak max file check
better to do - 32 than + 32 otherwise we may overflow oss-fuzz/13017
This commit is contained in:
@ -122,7 +122,7 @@ static bool LoadRAS(QDataStream &s, const RasHeader &ras, QImage &img)
|
||||
return false;
|
||||
}
|
||||
// QVector uses some extra space for stuff, hence the 32 here suggested by thiago
|
||||
if (ras.Length + 32 > std::numeric_limits<int>::max()) {
|
||||
if (ras.Length > std::numeric_limits<int>::max() - 32) {
|
||||
qWarning() << "LoadRAS() unsupported image length in file header" << ras.Length;
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user