Skip to content

Commit

Permalink
Merge pull request #4376 from assimp/kimkulling-lwo-enum-validation_i…
Browse files Browse the repository at this point in the history
…ssue4236-1

LWO: validate enum value before parsing it
  • Loading branch information
kimkulling committed Feb 7, 2022
2 parents a9e2864 + 389fc11 commit ed8612e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions code/AssetLib/LWO/LWOAnimation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,13 @@ AnimResolver::AnimResolver(std::list<Envelope> &_envelopes, double tick) :
(*it).old_first = 0;
(*it).old_last = (*it).keys.size() - 1;

if ((*it).keys.empty()) continue;
if ((*it).keys.empty()) {
continue;
}
if ((int)(*it).type < 1 || (int)(*it).type>EnvelopeType_Unknown) {
continue;
}
switch ((*it).type) {

// translation
case LWO::EnvelopeType_Position_X:
trans_x = &*it;
Expand Down

0 comments on commit ed8612e

Please sign in to comment.