Fix out-of-bounds read in MDLImporter

Fix https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=24502
pull/4146/head
Alex Rebert 2021-10-28 22:36:11 -04:00
parent 932dfe0562
commit 1fe9d405f5
No known key found for this signature in database
GPG Key ID: E082090D746F1A81
1 changed files with 1 additions and 1 deletions

View File

@ -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;