Fix compiler warnings in 32-bit builds
comparison of integers of different signs: 'unsigned int' and 'qsizetype' (aka 'int') [-Wsign-compare] Change-Id: Ia27f79ab4abca8b757b65ef5f1d30151842088fe Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit bc5fecf948f0038032d575d640ad4428ffbe89fd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
1a7faeef94
commit
a131f01b06
@ -148,7 +148,7 @@ QTextureFileData QKtxHandler::read()
|
|||||||
texData.setNumFaces(decode(header->numberOfFaces));
|
texData.setNumFaces(decode(header->numberOfFaces));
|
||||||
|
|
||||||
const quint32 bytesOfKeyValueData = decode(header->bytesOfKeyValueData);
|
const quint32 bytesOfKeyValueData = decode(header->bytesOfKeyValueData);
|
||||||
if (headerSize + bytesOfKeyValueData < buf.length()) // oob check
|
if (headerSize + bytesOfKeyValueData < quint64(buf.length())) // oob check
|
||||||
texData.setKeyValueMetadata(
|
texData.setKeyValueMetadata(
|
||||||
decodeKeyValues(QByteArrayView(buf.data() + headerSize, bytesOfKeyValueData)));
|
decodeKeyValues(QByteArrayView(buf.data() + headerSize, bytesOfKeyValueData)));
|
||||||
quint32 offset = headerSize + bytesOfKeyValueData;
|
quint32 offset = headerSize + bytesOfKeyValueData;
|
||||||
@ -227,7 +227,7 @@ QMap<QByteArray, QByteArray> QKtxHandler::decodeKeyValues(QByteArrayView view) c
|
|||||||
decode(qFromUnaligned<quint32>(view.constData() + offset));
|
decode(qFromUnaligned<quint32>(view.constData() + offset));
|
||||||
offset += sizeof(quint32);
|
offset += sizeof(quint32);
|
||||||
|
|
||||||
if (offset + keyAndValueByteSize > view.size())
|
if (offset + keyAndValueByteSize > quint64(view.size()))
|
||||||
break; // oob read
|
break; // oob read
|
||||||
|
|
||||||
// 'key' is a UTF-8 string ending with a null terminator, 'value' is the rest.
|
// 'key' is a UTF-8 string ending with a null terminator, 'value' is the rest.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user