diff --git a/src/imageformats/psd.cpp b/src/imageformats/psd.cpp index a8c206d..7c4c669 100644 --- a/src/imageformats/psd.cpp +++ b/src/imageformats/psd.cpp @@ -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()) {