xcf: Fix uninitialized memory use on broken documents

oss-fuzz #14312
This commit is contained in:
Albert Astals Cid 2019-04-17 20:09:17 +02:00
parent 645daec1ef
commit 6fea48c4ee

View File

@ -1078,6 +1078,9 @@ bool XCFImageFormat::loadLevel(QDataStream &xcf_io, Layer &layer, qint32 bpp)
for (uint j = 0; j < layer.nrows; j++) {
for (uint i = 0; i < layer.ncols; i++) {
layer.image_tiles[j][i].fill(Qt::transparent);
if (layer.type == GRAYA_GIMAGE || layer.type == INDEXEDA_GIMAGE) {
layer.alpha_tiles[j][i].fill(Qt::transparent);
}
}
}
return true;