mirror of
https://invent.kde.org/frameworks/kimageformats.git
synced 2025-11-21 01:42:44 -05:00
minor tweaks in HEIF and AVIF plugins
It is mostly only about casting between types.
This commit is contained in:
committed by
Albert Astals Cid
parent
dcab3a06ab
commit
3b1e8f7054
@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user