Check for indice bounds

This commit is contained in:
smallmodel 2023-11-01 23:06:14 +01:00
parent 3a6be342ce
commit 393c2a81d1
No known key found for this signature in database
GPG key ID: 9F2D623CEDF08512

View file

@ -391,7 +391,7 @@ void skeletor_c::SetPose( const frameInfo_t *frameInfo, const int *contIndices,
for( i = 0; i < 5; i++ )
{
contNum = contIndices[ i ];
if( contNum != -1 )
if( contNum >= 0 && contNum < m_Tiki->m_boneList.NumChannels() )
{
cutoff_weight = ( contValues[ i ][ 3 ] - 1.0 ) * ( contValues[ i ][ 3 ] - 1.0 );
if( cutoff_weight >= EPSILON )