ras: Fix assert because of ColorMapLength being too big

oss-fuzz/12785
This commit is contained in:
Albert Astals Cid
2019-01-31 01:02:57 +01:00
parent c2d2a9be66
commit de7a9a8457

View File

@ -251,6 +251,10 @@ bool RASHandler::read(QImage *outImage)
// Read image header.
RasHeader ras;
s >> ras;
if (ras.ColorMapLength > std::numeric_limits<int>::max())
return false;
// TODO: add support for old versions of RAS where Length may be zero in header
s.device()->seek(RasHeader::SIZE + ras.Length + ras.ColorMapLength);