XCF: fix crash (KF5)

This commit is contained in:
Mirco Miranda
2024-08-27 21:52:25 +00:00
committed by Albert Astals Cid
parent ec0918d962
commit f9f29304d8

View File

@ -1976,6 +1976,12 @@ static bool convertFloatTo16Bit(uchar *output, quint64 outputSize, uchar *input)
*/ */
bool XCFImageFormat::loadLevel(QDataStream &xcf_io, Layer &layer, qint32 bpp, const GimpPrecision precision) 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 width;
qint32 height; qint32 height;