diff --git a/src/imageformats/chunks.cpp b/src/imageformats/chunks.cpp index 8079ae5..35b12fe 100644 --- a/src/imageformats/chunks.cpp +++ b/src/imageformats/chunks.cpp @@ -3012,7 +3012,7 @@ QByteArray IDATChunk::strideRead(QIODevice *d, qint32 y, const IHDRChunk *header } if (header->model() == IHDRChunk::CLut4) { - if (rr.size() < header->width() / 2) { + if (rr.size() < (qint64(header->width()) + 1) / 2) { return {}; } QByteArray tmp(header->width(), char());