minor tweaks in HEIF and AVIF plugins

It is mostly only about casting between types.
This commit is contained in:
Daniel Novomeský
2022-11-19 11:38:49 +00:00
committed by Albert Astals Cid
parent dcab3a06ab
commit 3b1e8f7054
2 changed files with 6 additions and 5 deletions

View File

@ -15,6 +15,7 @@
#include <QDebug>
#include <QPointF>
#include <QSysInfo>
#include <limits>
#include <string.h>
namespace // Private.
@ -637,8 +638,8 @@ bool HEIFHandler::ensureDecoder()
heif_color_profile_type profileType = heif_image_handle_get_color_profile_type(handle.get_raw_image_handle());
struct heif_error err;
if (profileType == heif_color_profile_type_prof || profileType == heif_color_profile_type_rICC) {
int rawProfileSize = (int)heif_image_handle_get_raw_color_profile_size(handle.get_raw_image_handle());
if (rawProfileSize > 0) {
size_t rawProfileSize = heif_image_handle_get_raw_color_profile_size(handle.get_raw_image_handle());
if (rawProfileSize > 0 && rawProfileSize < std::numeric_limits<int>::max()) {
QByteArray ba(rawProfileSize, 0);
err = heif_image_handle_get_raw_color_profile(handle.get_raw_image_handle(), ba.data());
if (err.code) {
@ -650,7 +651,7 @@ bool HEIFHandler::ensureDecoder()
}
}
} else {
qWarning() << "icc profile is empty";
qWarning() << "icc profile is empty or above limits";
}
} else if (profileType == heif_color_profile_type_nclx) {