MDL: Do not try to copy empty embedded texture

- When an embedded texture is empty, skip it instead of trying to copy it. This must fail.
- closes https://github.com/assimp/assimp/issues/4238
- Found from the Google fuzzer.
pull/4284/head
Kim Kulling 2021-12-23 12:28:43 +01:00 committed by GitHub
parent 64af16c427
commit db2500c393
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -463,8 +463,12 @@ void MDLImporter::ParseSkinLump_3DGS_MDL7(
ASSIMP_LOG_WARN("Found a reference to an embedded DDS texture, "
"but texture height is not equal to 1, which is not supported by MED");
}
pcNew.reset(new aiTexture());
if (iWidth == 0) {
ASSIMP_LOG_ERROR("Found a reference to an embedded DDS texture, but texture width is zero, aborting import.");
return;
}
pcNew.reset(new aiTexture);
pcNew->mHeight = 0;
pcNew->mWidth = iWidth;