IFF: fix Integer-overflow in IDATChunk::strideSize

This commit is contained in:
Mirco Miranda
2026-03-23 12:05:01 +01:00
parent ec0610d5b0
commit 7c86ccaefb

View File

@ -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) {