Add checks for invalid buffer ans size (#5570)

This commit is contained in:
Kim Kulling
2024-05-13 08:55:10 +02:00
committed by GitHub
parent 47dbabadcd
commit 325b0a543f
2 changed files with 16 additions and 2 deletions
+7 -2
View File
@@ -233,8 +233,13 @@ const aiScene *aiImportFileFromMemoryWithProperties(
unsigned int pFlags,
const char *pHint,
const aiPropertyStore *props) {
ai_assert(nullptr != pBuffer);
ai_assert(0 != pLength);
if (pBuffer == nullptr) {
return nullptr;
}
if (pLength == 0u) {
return nullptr;
}
const aiScene *scene = nullptr;
ASSIMP_BEGIN_EXCEPTION_REGION();