mirror of
https://invent.kde.org/frameworks/kimageformats.git
synced 2025-05-28 00:30:23 -04:00
xcf: Fix Stack-buffer-overflow WRITE on broken files
oss-fuzz/33742
This commit is contained in:
parent
55b4077f2c
commit
297ed9a2fe
@ -537,6 +537,7 @@ inline QRgb qRgba(const QRgb rgb, int a)
|
|||||||
*/
|
*/
|
||||||
XCFImageFormat::XCFImageFormat()
|
XCFImageFormat::XCFImageFormat()
|
||||||
{
|
{
|
||||||
|
static_assert(sizeof(QRgb) == 4, "the code assumes sizeof(QRgb) == 4, if that's not your case, help us fix it :)");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -1361,6 +1362,11 @@ bool XCFImageFormat::loadHierarchy(QDataStream &xcf_io, Layer &layer)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (bpp > 4) {
|
||||||
|
qCDebug(XCFPLUGIN) << "bpp is" << bpp << "We don't support layers with bpp > 4";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// GIMP stores images in a "mipmap"-like format (multiple levels of
|
// GIMP stores images in a "mipmap"-like format (multiple levels of
|
||||||
// increasingly lower resolution). Only the top level is used here,
|
// increasingly lower resolution). Only the top level is used here,
|
||||||
// however.
|
// however.
|
||||||
|
Loading…
Reference in New Issue
Block a user