From c6c95b69f6da626e2a25140ede0bffe455c5178e Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 4 Jun 2023 08:07:19 +0000 Subject: [PATCH] Use SizeCheck --- code/AssetLib/MDL/MDLMaterialLoader.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/code/AssetLib/MDL/MDLMaterialLoader.cpp b/code/AssetLib/MDL/MDLMaterialLoader.cpp index bcd5f1d70..f42684e30 100644 --- a/code/AssetLib/MDL/MDLMaterialLoader.cpp +++ b/code/AssetLib/MDL/MDLMaterialLoader.cpp @@ -481,9 +481,7 @@ void MDLImporter::ParseSkinLump_3DGS_MDL7( pcNew->achFormatHint[2] = 's'; pcNew->achFormatHint[3] = '\0'; - if (szCurrent + pcNew->mWidth > this->mBuffer + this->iFileSize) { - throw DeadlyImportError("Invalid MDL file. Unexpected EOF"); - } + SizeCheck(szCurrent + pcNew->mWidth); pcNew->pcData = (aiTexel *)new unsigned char[pcNew->mWidth]; memcpy(pcNew->pcData, szCurrent, pcNew->mWidth);