Forráskód Böngészése

Fix out-of-bounds read in MDLImporter

Fix https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=24502
Alex Rebert 3 éve
szülő
commit
1fe9d405f5
1 módosított fájl, 1 hozzáadás és 1 törlés
  1. 1 1
      code/AssetLib/MDL/MDLLoader.cpp

+ 1 - 1
code/AssetLib/MDL/MDLLoader.cpp

@@ -600,7 +600,7 @@ void MDLImporter::InternReadFile_3DGS_MDL345() {
 
     // need to read all textures
     for (unsigned int i = 0; i < (unsigned int)pcHeader->num_skins; ++i) {
-        if (szCurrent >= szEnd) {
+        if (szCurrent + sizeof(uint32_t) > szEnd) {
             throw DeadlyImportError("Texture data past end of file.");
         }
         BE_NCONST MDL::Skin *pcSkin;