ras: Return false if allocating the image failed

Probably because it's too huge
This commit is contained in:
Albert Astals Cid 2019-01-29 12:32:23 +01:00
parent 6dcea7fd01
commit e34f53d6ae

View File

@ -131,6 +131,9 @@ static bool LoadRAS(QDataStream &s, const RasHeader &ras, QImage &img)
// Allocate image
img = QImage(ras.Width, ras.Height, QImage::Format_ARGB32);
if (img.isNull())
return false;
// Reconstruct image from RGB palette if we have a palette
// TODO: make generic so it works with 24bit or 32bit palettes
if (ras.ColorMapType == 1 && ras.Depth == 8) {