소스 검색

prevent zero sized array allocations

CwTCwT 7 년 전
부모
커밋
7db668e66f
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  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);