Skip to content

Commit d70606b

Browse files
tyler92kimkulling
andauthored
Verify negative values in Quake1 MDL header (assimp#5940)
Co-authored-by: Kim Kulling <[email protected]>
1 parent 69558d8 commit d70606b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

code/AssetLib/MDL/MDLLoader.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -325,13 +325,13 @@ void MDLImporter::SizeCheck(const void *szPos, const char *szFile, unsigned int
325325
// Validate a quake file header
326326
void MDLImporter::ValidateHeader_Quake1(const MDL::Header *pcHeader) {
327327
// some values may not be nullptr
328-
if (!pcHeader->num_frames)
328+
if (pcHeader->num_frames <= 0)
329329
throw DeadlyImportError("[Quake 1 MDL] There are no frames in the file");
330330

331-
if (!pcHeader->num_verts)
331+
if (pcHeader->num_verts <= 0)
332332
throw DeadlyImportError("[Quake 1 MDL] There are no vertices in the file");
333333

334-
if (!pcHeader->num_tris)
334+
if (pcHeader->num_tris <= 0)
335335
throw DeadlyImportError("[Quake 1 MDL] There are no triangles in the file");
336336

337337
// check whether the maxima are exceeded ...however, this applies for Quake 1 MDLs only

0 commit comments

Comments
 (0)