Skip to content

Commit

Permalink
PtexReader.cpp: validate mesh_type in header on open
Browse files Browse the repository at this point in the history
Signed-off-by: matt rice <[email protected]>
  • Loading branch information
ratmice committed Apr 20, 2024
1 parent ea6890e commit 3017a4c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/ptex/PtexReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,14 @@ bool PtexReader::open(const char* pathArg, Ptex::String& error)
closeFP();
return 0;
}
if (!(_header.meshtype == mt_triangle || _header.meshtype == mt_quad)) {
std::stringstream s;
s << "Invalid mesh type (" << _header.meshtype << "): " << pathArg;
error = s.str();
_ok = 0;
closeFP();
return 0;
}
_pixelsize = _header.pixelSize();
_errorPixel.resize(_pixelsize);

Expand Down

0 comments on commit 3017a4c

Please sign in to comment.