Skip to content

Commit

Permalink
Add sanity check to CAnimManagerSA::GetAnimBlendAssocGroup
Browse files Browse the repository at this point in the history
  • Loading branch information
codenulls committed Apr 12, 2019
1 parent 33b41c5 commit 68212b1
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions Client/game_sa/CAnimManagerSA.cpp
Expand Up @@ -778,13 +778,16 @@ CAnimBlendAssocGroup* CAnimManagerSA::GetAnimBlendAssocGroup(CAnimBlendAssocGrou
if (pInterface)
{
AssocGroupId groupID = pInterface->groupID;
if (!m_pAnimAssocGroups[groupID])
if (groupID < TOTAL_ANIM_GROUPS)
{
m_pAnimAssocGroups[groupID] = new CAnimBlendAssocGroupSA(pInterface);
if (!m_pAnimAssocGroups[groupID])
{
m_pAnimAssocGroups[groupID] = new CAnimBlendAssocGroupSA(pInterface);
}
return m_pAnimAssocGroups[groupID];
}
return m_pAnimAssocGroups[groupID];
}
return NULL;
return nullptr;
}

CAnimBlock* CAnimManagerSA::GetAnimBlock(CAnimBlockSAInterface* pInterface)
Expand All @@ -801,7 +804,7 @@ CAnimBlock* CAnimManagerSA::GetAnimBlock(CAnimBlockSAInterface* pInterface)
return m_pAnimBlocks[ID];
}
}
return NULL;
return nullptr;
}

std::unique_ptr<CAnimBlendHierarchy> CAnimManagerSA::GetAnimBlendHierarchy(CAnimBlendHierarchySAInterface* pInterface)
Expand Down

0 comments on commit 68212b1

Please sign in to comment.