mirror of
https://invent.kde.org/frameworks/kimageformats.git
synced 2025-11-21 01:42:44 -05:00
Fix image allocation with Qt 6
To make the plugins fail to allocate if the image size is greater than QImageReader::allocationLimit() it is necessary to allocate the image with QImageIOHandler::allocateImage(). Note that not all plugins have been changed and some others are not tested in the CI (maybe due to missing libraries). PS: the following message is printed by QImageIOHandler::allocateImage() if the size is exceeded: "qt.gui.imageio: QImageIOHandler: Rejecting image as it exceeds the current allocation limit of XXX megabytes"
This commit is contained in:
committed by
Albert Astals Cid
parent
dfbc6e0f8c
commit
feb6d9b20f
@ -9,6 +9,7 @@
|
||||
|
||||
#include "heif_p.h"
|
||||
#include "libheif/heif_cxx.h"
|
||||
#include "util_p.h"
|
||||
|
||||
#include <QColorSpace>
|
||||
#include <QDebug>
|
||||
@ -432,7 +433,7 @@ bool HEIFHandler::ensureDecoder()
|
||||
return false;
|
||||
}
|
||||
|
||||
m_current_image = QImage(imageSize, target_image_format);
|
||||
m_current_image = imageAlloc(imageSize, target_image_format);
|
||||
if (m_current_image.isNull()) {
|
||||
m_parseState = ParseHeicError;
|
||||
qWarning() << "Unable to allocate memory!";
|
||||
|
||||
Reference in New Issue
Block a user