From 850068c1dc81c2ae0867cf395ae488f6d6c33781 Mon Sep 17 00:00:00 2001 From: Mirco Miranda Date: Tue, 22 Apr 2025 08:01:02 +0200 Subject: [PATCH] JXR: fix compilation error on 32-bit systems --- src/imageformats/jxr.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/imageformats/jxr.cpp b/src/imageformats/jxr.cpp index 7e535f1..7124f53 100644 --- a/src/imageformats/jxr.cpp +++ b/src/imageformats/jxr.cpp @@ -977,9 +977,9 @@ bool JXRHandler::read(QImage *outImage) return false; } } else { // additional buffer needed - qsizetype convStrideSize = (img.width() * d->pDecoder->WMP.wmiI.cBitsPerUnit + 7) / 8; - qsizetype buffSize = convStrideSize * img.height(); - qsizetype limit = QImageReader::allocationLimit(); + qint64 convStrideSize = (img.width() * d->pDecoder->WMP.wmiI.cBitsPerUnit + 7) / 8; + qint64 buffSize = convStrideSize * img.height(); + qint64 limit = QImageReader::allocationLimit(); if (limit && (buffSize + img.sizeInBytes()) > limit * 1024 * 1024) { qCWarning(LOG_JXRPLUGIN) << "JXRHandler::read() unable to covert due to allocation limit set:" << limit << "MiB"; return false; @@ -991,7 +991,7 @@ bool JXRHandler::read(QImage *outImage) return false; } for (qint32 y = 0, h = img.height(); y < h; ++y) { - std::memcpy(img.scanLine(y), ba.data() + convStrideSize * y, (std::min)(convStrideSize, img.bytesPerLine())); + std::memcpy(img.scanLine(y), ba.data() + convStrideSize * y, (std::min)(convStrideSize, qint64(img.bytesPerLine()))); } } PKFormatConverter_Release(&pConverter);