mirror of
https://invent.kde.org/frameworks/kimageformats.git
synced 2025-06-03 17:08:08 -04:00
jxr: Use qsizetype for image size variables
Fixes type mismatch on 32-bit architectures. /builddir/build/BUILD/kf6-kimageformats-6.13.0-build/kimageformats-6.13.0/src/imageformats/jxr.cpp: In member function ‘virtual bool JXRHandler::read(QImage*)’: /builddir/build/BUILD/kf6-kimageformats-6.13.0-build/kimageformats-6.13.0/src/imageformats/jxr.cpp:994:88: error: no matching function for call to ‘min(qint64&, qsizetype)’ 994 | std::memcpy(img.scanLine(y), ba.data() + convStrideSize * y, (std::min)(convStrideSize, img.bytesPerLine())); | ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This commit is contained in:
parent
dd69fdaea9
commit
2adca7c0ca
@ -977,9 +977,9 @@ bool JXRHandler::read(QImage *outImage)
|
||||
return false;
|
||||
}
|
||||
} else { // additional buffer needed
|
||||
qint64 convStrideSize = (img.width() * d->pDecoder->WMP.wmiI.cBitsPerUnit + 7) / 8;
|
||||
qint64 buffSize = convStrideSize * img.height();
|
||||
qint64 limit = QImageReader::allocationLimit();
|
||||
qsizetype convStrideSize = (img.width() * d->pDecoder->WMP.wmiI.cBitsPerUnit + 7) / 8;
|
||||
qsizetype buffSize = convStrideSize * img.height();
|
||||
qsizetype 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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user