Commit d56b7b29 authored by Ivan Yossi's avatar Ivan Yossi 👌 Committed by Boudewijn Rempt

Avoidp parsing data if is not detected as String

deviceSettingDescription can be any type of data.

BUG:410242
parent acf34791
......@@ -229,8 +229,7 @@ KisMetaData::Value deviceSettingDescriptionExifToKMD(const Exiv2::Value::AutoPtr
QByteArray array;
const Exiv2::DataValue* dvalue = dynamic_cast<const Exiv2::DataValue*>(&*value);
if(dvalue)
{
if (dvalue) {
array.resize(dvalue->count());
dvalue->copy((Exiv2::byte*)array.data());
} else {
......@@ -248,6 +247,7 @@ KisMetaData::Value deviceSettingDescriptionExifToKMD(const Exiv2::Value::AutoPtr
for (int index = 4; index < array.size(); )
{
const int lastIndex = array.indexOf(null, index);
if (lastIndex < 0) break; // Data is not a String, ignore
const int numChars = (lastIndex - index) / 2; // including trailing zero
QString setting = QString::fromUtf16((ushort*)(void*)( array.data() + index), numChars);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment