summaryrefslogtreecommitdiffstats
path: root/src/gui/util
diff options
context:
space:
mode:
authorEirik Aavitsland <eirik.aavitsland@qt.io>2018-08-03 11:48:14 +0200
committerEirik Aavitsland <eirik.aavitsland@qt.io>2018-08-06 12:04:08 +0000
commit7dfc3ed663d3f01568f18b204af5ea102c582979 (patch)
tree8d24d3c9eda95693e2eb2fdcc2640e25854e62eb /src/gui/util
parent819cad6670fd5ae7f36bcae9750bb180e92cb206 (diff)
Fix potential out of bounds read in qpkmhandler
Off-by-one bug in the validity test of the texture type field. Change-Id: I46ded85a0ad93166aa886e71f0c391f27e79f64f Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Diffstat (limited to 'src/gui/util')
-rw-r--r--src/gui/util/qpkmhandler.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/util/qpkmhandler.cpp b/src/gui/util/qpkmhandler.cpp
index 4481deaa8e..e0c3b75efe 100644
--- a/src/gui/util/qpkmhandler.cpp
+++ b/src/gui/util/qpkmhandler.cpp
@@ -92,7 +92,7 @@ QTextureFileData QPkmHandler::read()
// texture type
quint16 type = qFromBigEndian<quint16>(rawData + 6);
- if (type > sizeof(typeMap)/sizeof(typeMap[0])) {
+ if (type >= sizeof(typeMap)/sizeof(typeMap[0])) {
qCDebug(lcQtGuiTextureIO, "Unknown compression format in PKM file %s", logName().constData());
return QTextureFileData();
}