Skip to content

Commit

Permalink
imdload.cpp: Additional sanity check
Browse files Browse the repository at this point in the history
  • Loading branch information
past-due committed Aug 11, 2024
1 parent ad6a918 commit aafbe2f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/ivis_opengl/imdload.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1482,6 +1482,11 @@ static std::unique_ptr<iIMDShape> _imd_load_level(const WzString &filename, cons
else if (strcmp(buffer, "ANIMOBJECT") == 0)
{
s.objanimtime = value;
if (s.objanimtime == 0)
{
debug(LOG_ERROR, "%s bad ANIMOBJ time: %" PRIu32, filename.toUtf8().c_str(), value);
return nullptr;
}
const char* pRestOfLine = lineToProcess.lineContents.c_str() + cnt;
if (sscanf(pRestOfLine, "%d %d%n", &s.objanimcycles, &s.objanimframes, &cnt) != 2)
{
Expand Down

0 comments on commit aafbe2f

Please sign in to comment.