From 7c86ccaefb2827230b7a31ac62444ebcb535d70c Mon Sep 17 00:00:00 2001 From: Mirco Miranda Date: Mon, 23 Mar 2026 12:05:01 +0100 Subject: [PATCH] IFF: fix Integer-overflow in IDATChunk::strideSize --- src/imageformats/chunks.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/imageformats/chunks.cpp b/src/imageformats/chunks.cpp index 35b12fe..ccecd89 100644 --- a/src/imageformats/chunks.cpp +++ b/src/imageformats/chunks.cpp @@ -3092,7 +3092,8 @@ quint32 IDATChunk::strideSize(const IHDRChunk *header) const return 0; } - auto rs = (header->width() * header->depth() + 7) / 8; + // width() and depth() are at most 65535 + auto rs = (quint32(header->width()) * header->depth() + 7) / 8; // No padding bytes are inserted in the data. if (header->model() == IHDRChunk::Rgb888) {