Explorar o código

prevent zero sized array allocations

CwTCwT %!s(int64=7) %!d(string=hai) anos
pai
achega
7db668e66f
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      code/BlenderCustomData.cpp

+ 1 - 1
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);