Always initialize joint_names in R_LoadIQM

Reported by MAN-AT-ARMS
This commit is contained in:
Zack Middleton 2013-03-18 15:55:25 -05:00
parent 9a752ce8cd
commit 98dda7758f
2 changed files with 4 additions and 2 deletions

View file

@ -338,6 +338,8 @@ qboolean R_LoadIQM( model_t *mod, void *buffer, int filesize, const char *mod_na
return qfalse; return qfalse;
} }
joint_names = 0;
if ( header->num_joints ) if ( header->num_joints )
{ {
// check and swap joints // check and swap joints
@ -346,7 +348,6 @@ qboolean R_LoadIQM( model_t *mod, void *buffer, int filesize, const char *mod_na
return qfalse; return qfalse;
} }
joint = (iqmJoint_t *)((byte *)header + header->ofs_joints); joint = (iqmJoint_t *)((byte *)header + header->ofs_joints);
joint_names = 0;
for( i = 0; i < header->num_joints; i++, joint++ ) { for( i = 0; i < header->num_joints; i++, joint++ ) {
LL( joint->name ); LL( joint->name );
LL( joint->parent ); LL( joint->parent );

View file

@ -338,6 +338,8 @@ qboolean R_LoadIQM( model_t *mod, void *buffer, int filesize, const char *mod_na
return qfalse; return qfalse;
} }
joint_names = 0;
if ( header->num_joints ) if ( header->num_joints )
{ {
// check and swap joints // check and swap joints
@ -346,7 +348,6 @@ qboolean R_LoadIQM( model_t *mod, void *buffer, int filesize, const char *mod_na
return qfalse; return qfalse;
} }
joint = (iqmJoint_t *)((byte *)header + header->ofs_joints); joint = (iqmJoint_t *)((byte *)header + header->ofs_joints);
joint_names = 0;
for( i = 0; i < header->num_joints; i++, joint++ ) { for( i = 0; i < header->num_joints; i++, joint++ ) {
LL( joint->name ); LL( joint->name );
LL( joint->parent ); LL( joint->parent );