mirror of
https://invent.kde.org/frameworks/kimageformats.git
synced 2025-07-18 03:54:18 -04:00
SGIImage::writeImage: Properly fail if the image is too big
This commit is contained in:
@ -681,9 +681,16 @@ bool SGIImage::writeImage(const QImage &image)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const int w = img.width();
|
||||||
|
const int h = img.height();
|
||||||
|
|
||||||
|
if (w > 65536 || h > 65536) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
_bpc = 1;
|
_bpc = 1;
|
||||||
_xsize = img.width();
|
_xsize = w;
|
||||||
_ysize = img.height();
|
_ysize = h;
|
||||||
_pixmin = ~0u;
|
_pixmin = ~0u;
|
||||||
_pixmax = 0;
|
_pixmax = 0;
|
||||||
_colormap = NORMAL;
|
_colormap = NORMAL;
|
||||||
|
Reference in New Issue
Block a user