mirror of
https://invent.kde.org/frameworks/kimageformats.git
synced 2025-07-19 12:14:20 -04:00
xcf: Fix uninitialized memory use on broken documents
oss-fuzz/12871
This commit is contained in:
@ -1063,6 +1063,13 @@ bool XCFImageFormat::loadLevel(QDataStream &xcf_io, Layer &layer, qint32 bpp)
|
||||
xcf_io >> width >> height >> offset;
|
||||
|
||||
if (offset == 0) {
|
||||
// offset 0 with rowsxcols != 0 is probably an error since it means we have tiles
|
||||
// without data but just clear the bits for now instead of returning false
|
||||
for (uint j = 0; j < layer.nrows; j++) {
|
||||
for (uint i = 0; i < layer.ncols; i++) {
|
||||
layer.image_tiles[j][i].fill(Qt::transparent);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user