summaryrefslogtreecommitdiffstats
path: root/src/gui/util/qktxhandler.cpp
diff options
context:
space:
mode:
authorRobert Löhning <robert.loehning@qt.io>2021-03-15 19:04:24 +0100
committerRobert Löhning <robert.loehning@qt.io>2021-03-17 09:12:05 +0000
commitbc5fecf948f0038032d575d640ad4428ffbe89fd (patch)
treefc513973a7a21b5b141e94d5889afdad2139d902 /src/gui/util/qktxhandler.cpp
parentf7c292a713251cd20f40a9a21638496ac9f61fb9 (diff)
Fix compiler warnings in 32-bit builds
comparison of integers of different signs: 'unsigned int' and 'qsizetype' (aka 'int') [-Wsign-compare] Pick-to: 6.1 Change-Id: Ia27f79ab4abca8b757b65ef5f1d30151842088fe Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'src/gui/util/qktxhandler.cpp')
-rw-r--r--src/gui/util/qktxhandler.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/util/qktxhandler.cpp b/src/gui/util/qktxhandler.cpp
index cd8ca3635e..9f4545f3af 100644
--- a/src/gui/util/qktxhandler.cpp
+++ b/src/gui/util/qktxhandler.cpp
@@ -148,7 +148,7 @@ QTextureFileData QKtxHandler::read()
texData.setNumFaces(decode(header->numberOfFaces));
const quint32 bytesOfKeyValueData = decode(header->bytesOfKeyValueData);
- if (headerSize + bytesOfKeyValueData < buf.length()) // oob check
+ if (headerSize + bytesOfKeyValueData < quint64(buf.length())) // oob check
texData.setKeyValueMetadata(
decodeKeyValues(QByteArrayView(buf.data() + headerSize, bytesOfKeyValueData)));
quint32 offset = headerSize + bytesOfKeyValueData;
@@ -227,7 +227,7 @@ QMap<QByteArray, QByteArray> QKtxHandler::decodeKeyValues(QByteArrayView view) c
decode(qFromUnaligned<quint32>(view.constData() + offset));
offset += sizeof(quint32);
- if (offset + keyAndValueByteSize > view.size())
+ if (offset + keyAndValueByteSize > quint64(view.size()))
break; // oob read
// 'key' is a UTF-8 string ending with a null terminator, 'value' is the rest.