mirror of
https://invent.kde.org/frameworks/kimageformats.git
synced 2025-06-03 17:08:08 -04:00
ras: Return false if allocating the image failed
Probably because it's too huge
This commit is contained in:
parent
6dcea7fd01
commit
e34f53d6ae
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user