diff --git a/source/build/src/engine.cpp b/source/build/src/engine.cpp index ce07b885b..7fb996d04 100644 --- a/source/build/src/engine.cpp +++ b/source/build/src/engine.cpp @@ -10157,6 +10157,9 @@ void videoNextPage(void) int32_t qloadkvx(int32_t voxindex, const char *filename) { + if ((unsigned)voxindex >= MAXVOXELS) + return -1; + auto fil = fileSystem.OpenFileReader(filename, 0); if (!fil.isOpen()) return -1;