2
0
mirror of https://github.com/rehlds/rehlds.git synced 2025-01-14 15:48:04 +03:00

GetBonePosition: Added bone index bounds check

This commit is contained in:
s1lentq 2023-07-04 01:39:26 +07:00
parent 8841ba4aec
commit 918612fa23

View File

@ -881,6 +881,15 @@ void EXT_FUNC AnimationAutomove(const edict_t *pEdict, float flTime)
void EXT_FUNC GetBonePosition(const edict_t *pEdict, int iBone, float *rgflOrigin, float *rgflAngles)
{
pstudiohdr = (studiohdr_t *)Mod_Extradata(g_psv.models[pEdict->v.modelindex]);
#ifdef REHLDS_FIXES
if (!pstudiohdr)
return;
if (iBone < 0 || iBone >= pstudiohdr->numbones)
return; // invalid bone
#endif
g_pSvBlendingAPI->SV_StudioSetupBones(
g_psv.models[pEdict->v.modelindex],
pEdict->v.frame,