prevent zero sized array allocations

pull/2005/head
CwTCwT 2018-06-09 23:36:42 +02:00
parent 959c0e8907
commit 7db668e66f
1 changed files with 1 additions and 1 deletions

View File

@ -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);