diff --git a/Core/Libraries/Source/WWVegas/WW3D2/htree.cpp b/Core/Libraries/Source/WWVegas/WW3D2/htree.cpp index fc64894f36b..17ed63aa849 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/htree.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/htree.cpp @@ -209,9 +209,10 @@ int HTreeClass::Load_W3D(ChunkLoadClass & cload) */ memcpy(Name,header.Name,W3D_NAME_LEN); NumPivots = header.NumPivots; - if (NumPivots > 0) { - Pivot = MSGW3DNEWARRAY("HTreeClass::Pivot") PivotClass[NumPivots]; + if (NumPivots < 1) { + return LOAD_ERROR; } + Pivot = MSGW3DNEWARRAY("HTreeClass::Pivot") PivotClass[NumPivots]; /* ** Now, read in all of the other chunks for this hierarchy.