Use SizeCheck

pull/5128/head
Alex 2023-06-04 08:07:19 +00:00
parent 54b0c00418
commit c6c95b69f6
1 changed files with 1 additions and 3 deletions

View File

@ -481,9 +481,7 @@ void MDLImporter::ParseSkinLump_3DGS_MDL7(
pcNew->achFormatHint[2] = 's'; pcNew->achFormatHint[2] = 's';
pcNew->achFormatHint[3] = '\0'; pcNew->achFormatHint[3] = '\0';
if (szCurrent + pcNew->mWidth > this->mBuffer + this->iFileSize) { SizeCheck(szCurrent + pcNew->mWidth);
throw DeadlyImportError("Invalid MDL file. Unexpected EOF");
}
pcNew->pcData = (aiTexel *)new unsigned char[pcNew->mWidth]; pcNew->pcData = (aiTexel *)new unsigned char[pcNew->mWidth];
memcpy(pcNew->pcData, szCurrent, pcNew->mWidth); memcpy(pcNew->pcData, szCurrent, pcNew->mWidth);