XCF: fix crash

This commit is contained in:
Mirco Miranda 2024-08-27 21:52:16 +00:00 committed by Albert Astals Cid
parent 145dedf360
commit 8588c053b6

View File

@ -1974,6 +1974,12 @@ static bool convertFloatTo16Bit(uchar *output, quint64 outputSize, uchar *input)
*/
bool XCFImageFormat::loadLevel(QDataStream &xcf_io, Layer &layer, qint32 bpp, const GimpPrecision precision)
{
auto bpc = bytesPerChannel(precision);
if ((bpc == 0) || (bpp % bpc)) {
qCDebug(XCFPLUGIN) << "XCF: the stream seems corrupted";
return false;
}
qint32 width;
qint32 height;