diff options
author | Kim Kulling <kimkulling@users.noreply.github.com> | 2022-02-07 10:02:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-07 10:02:13 +0100 |
commit | ed8612ea356021080898ea2378f0b545431ccae3 (patch) | |
tree | 1cc2fce76179c94cb15287be7f5250a3ea2b8082 | |
parent | a9e2864cb4e5603aa4a544da2e573b3414cfe7e3 (diff) | |
parent | 389fc11e5b47dae59a7f21ff920a440d58315c44 (diff) |
Merge pull request #4376 from assimp/kimkulling-lwo-enum-validation_issue4236-1v5.2.1
LWO: validate enum value before parsing it
-rw-r--r-- | code/AssetLib/LWO/LWOAnimation.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/code/AssetLib/LWO/LWOAnimation.cpp b/code/AssetLib/LWO/LWOAnimation.cpp index 49fa45746..c2ee2d9c0 100644 --- a/code/AssetLib/LWO/LWOAnimation.cpp +++ b/code/AssetLib/LWO/LWOAnimation.cpp @@ -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; |