ras: don't assert because we try to allicate a huge vector

oss-fuzz/12915
This commit is contained in:
Albert Astals Cid 2019-02-06 22:06:58 +01:00
parent b072484dbb
commit 039d7d8fbe

View File

@ -121,6 +121,10 @@ static bool LoadRAS(QDataStream &s, const RasHeader &ras, QImage &img)
qWarning() << "LoadRAS() mistmatch between height and width" << ras.Width << ras.Height << ras.Length << ras.Depth;
return false;
}
if (ras.Length > std::numeric_limits<int>::max()) {
qWarning() << "LoadRAS() unsupported image length in file header" << ras.Length;
return false;
}
// each line must be a factor of 16 bits, so they may contain padding
// this will be 1 if padding required, 0 otherwise