mirror of
https://invent.kde.org/frameworks/kimageformats.git
synced 2025-05-28 00:30:23 -04:00
Protect against too big resize for a QByteArray
oss-fuzz/48480
This commit is contained in:
parent
e6955e1f03
commit
62e477a6f2
@ -938,6 +938,9 @@ inline void labToRgb(uchar *target, qint32 targetChannels, const char *source, q
|
||||
bool readChannel(QByteArray& target, QDataStream &stream, quint32 compressedSize, quint16 compression)
|
||||
{
|
||||
if (compression) {
|
||||
if (compressedSize > kMaxQVectorSize) {
|
||||
return false;
|
||||
}
|
||||
QByteArray tmp;
|
||||
tmp.resize(compressedSize);
|
||||
if (stream.readRawData(tmp.data(), tmp.size()) != tmp.size()) {
|
||||
|
Loading…
Reference in New Issue
Block a user