From 8602c7c035796f20a4ebb210ef88e93fd20f540d Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Mon, 7 Feb 2022 09:08:22 +0100 Subject: [PATCH] LWO: validate enum value before parsing it - Check for valid enum values - closes https://github.com/assimp/assimp/issues/4236 --- code/AssetLib/LWO/LWOAnimation.cpp | 8 ++++++-- 1 file 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 &_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;