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>bb10
parent
819cad6670
commit
7dfc3ed663
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue