diff --git a/libraries/ktx/src/ktx/Reader.cpp b/libraries/ktx/src/ktx/Reader.cpp index 81f523cb69..5aa6919844 100644 --- a/libraries/ktx/src/ktx/Reader.cpp +++ b/libraries/ktx/src/ktx/Reader.cpp @@ -101,7 +101,7 @@ namespace ktx { // find the first null character \0 and extract the key uint32_t keyLength = 0; - while (reinterpret_cast(keyValueBytes[++keyLength]) != '\0') { + while (reinterpret_cast(keyValueBytes)[++keyLength] != '\0') { if (keyLength == keyAndValueByteSize) { // key must be null-terminated, and there must be space for the value throw ReaderException("invalid key-value " + std::string(reinterpret_cast(keyValueBytes), keyLength));