mirror of
https://invent.kde.org/frameworks/kimageformats.git
synced 2026-05-25 13:08:28 -04:00
JXR: fix Use-of-uninitialized-value
This commit is contained in:
committed by
Mirco Miranda
parent
bc398382ac
commit
51db11eefc
@@ -400,7 +400,7 @@ public:
|
|||||||
QSize imageSize() const
|
QSize imageSize() const
|
||||||
{
|
{
|
||||||
if (pDecoder) {
|
if (pDecoder) {
|
||||||
qint32 w, h;
|
qint32 w = 0, h = 0;
|
||||||
pDecoder->GetSize(pDecoder, &w, &h);
|
pDecoder->GetSize(pDecoder, &w, &h);
|
||||||
if (w > JXR_MAX_IMAGE_WIDTH || h > JXR_MAX_IMAGE_HEIGHT || w < 1 || h < 1) {
|
if (w > JXR_MAX_IMAGE_WIDTH || h > JXR_MAX_IMAGE_HEIGHT || w < 1 || h < 1) {
|
||||||
qCCritical(LOG_JXRPLUGIN) << "JXRHandlerPrivate::imageSize() Maximum image size is limited to" << JXR_MAX_IMAGE_WIDTH << "x"
|
qCCritical(LOG_JXRPLUGIN) << "JXRHandlerPrivate::imageSize() Maximum image size is limited to" << JXR_MAX_IMAGE_WIDTH << "x"
|
||||||
@@ -422,7 +422,7 @@ public:
|
|||||||
if (pDecoder == nullptr) {
|
if (pDecoder == nullptr) {
|
||||||
return cs;
|
return cs;
|
||||||
}
|
}
|
||||||
quint32 size;
|
quint32 size = 0;
|
||||||
if (!pDecoder->GetColorContext(pDecoder, nullptr, &size) && size) {
|
if (!pDecoder->GetColorContext(pDecoder, nullptr, &size) && size) {
|
||||||
QByteArray ba(size, 0);
|
QByteArray ba(size, 0);
|
||||||
if (!pDecoder->GetColorContext(pDecoder, reinterpret_cast<quint8 *>(ba.data()), &size)) {
|
if (!pDecoder->GetColorContext(pDecoder, reinterpret_cast<quint8 *>(ba.data()), &size)) {
|
||||||
@@ -443,7 +443,7 @@ public:
|
|||||||
return xmp;
|
return xmp;
|
||||||
}
|
}
|
||||||
#ifdef JXR_ENABLE_ADVANCED_METADATA
|
#ifdef JXR_ENABLE_ADVANCED_METADATA
|
||||||
quint32 size;
|
quint32 size = 0;
|
||||||
if (!PKImageDecode_GetXMPMetadata_WMP(pDecoder, nullptr, &size) && size > 0 && size < JXR_MAX_METADATA_SIZE) {
|
if (!PKImageDecode_GetXMPMetadata_WMP(pDecoder, nullptr, &size) && size > 0 && size < JXR_MAX_METADATA_SIZE) {
|
||||||
QByteArray ba(size, 0);
|
QByteArray ba(size, 0);
|
||||||
if (!PKImageDecode_GetXMPMetadata_WMP(pDecoder, reinterpret_cast<quint8 *>(ba.data()), &size)) {
|
if (!PKImageDecode_GetXMPMetadata_WMP(pDecoder, reinterpret_cast<quint8 *>(ba.data()), &size)) {
|
||||||
@@ -1018,7 +1018,7 @@ bool JXRHandler::read(QImage *outImage)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// resolution
|
// resolution
|
||||||
float hres, vres;
|
float hres = 0, vres = 0;
|
||||||
if (auto err = d->pDecoder->GetResolution(d->pDecoder, &hres, &vres)) {
|
if (auto err = d->pDecoder->GetResolution(d->pDecoder, &hres, &vres)) {
|
||||||
qCWarning(LOG_JXRPLUGIN) << "JXRHandler::read() error while reading resolution:" << err;
|
qCWarning(LOG_JXRPLUGIN) << "JXRHandler::read() error while reading resolution:" << err;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user