Protect against too big resize for a QByteArray

oss-fuzz/48480
This commit is contained in:
Albert Astals Cid
2022-08-15 10:24:40 +00:00
parent e6955e1f03
commit 62e477a6f2
+3
View File
@@ -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()) {