mirror of
https://invent.kde.org/frameworks/kimageformats.git
synced 2025-06-03 00:58:15 -04:00
xcf: Fix crash on broken files
This commit is contained in:
parent
acd6b3970c
commit
4478bc8d2b
@ -1672,8 +1672,12 @@ bool XCFImageFormat::assignImageBytes(Layer &layer, uint i, uint j, const GimpPr
|
||||
for (int y = 0; y < height; y++) {
|
||||
uchar *dataPtr = bits + y * bytesPerLine;
|
||||
uchar *alphaPtr = nullptr;
|
||||
if (!layer.alpha_tiles.isEmpty())
|
||||
alphaPtr = layer.alpha_tiles[j][i].scanLine(y);
|
||||
if (!layer.alpha_tiles.isEmpty()) {
|
||||
QImage &alphaTile = layer.alpha_tiles[j][i];
|
||||
if (alphaTile.width() >= width && alphaTile.height() > y) {
|
||||
alphaPtr = alphaTile.scanLine(y);
|
||||
}
|
||||
}
|
||||
if (bpc == 4) {
|
||||
#ifdef USE_FLOAT_IMAGES
|
||||
if (precision < GimpPrecision::GIMP_PRECISION_HALF_LINEAR) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user