From 7db668e66f7d95f3b95970345a37a70c2e177c76 Mon Sep 17 00:00:00 2001 From: CwTCwT Date: Sat, 9 Jun 2018 23:36:42 +0200 Subject: [PATCH] prevent zero sized array allocations --- code/BlenderCustomData.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/BlenderCustomData.cpp b/code/BlenderCustomData.cpp index f52a4ca51..434a2c60b 100644 --- a/code/BlenderCustomData.cpp +++ b/code/BlenderCustomData.cpp @@ -155,7 +155,7 @@ namespace Assimp { } const CustomDataTypeDescription cdtd = customDataTypeDescriptions[cdtype]; - if (cdtd.Read && cdtd.Create && cdtd.Destroy) { + if (cdtd.Read && cdtd.Create && cdtd.Destroy && cnt > 0) { // allocate cnt elements and parse them from file out.reset(cdtd.Create(cnt), cdtd.Destroy); return cdtd.Read(out.get(), cnt, db);