summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZack Middleton <zturtleman@gmail.com>2013-03-18 15:55:25 -0500
committerTim Angus <tim@ngus.net>2013-03-19 16:41:21 +0000
commit1f391d180b9702b6859cd247bdaf94f18c677727 (patch)
tree82d99ee3e37c322c4b26ade2a56985fbc8c2b209
parent82e6bde5832ea0d9daf349535889d4dd19c92942 (diff)
Always initialize joint_names in R_LoadIQM
Reported by MAN-AT-ARMS
-rw-r--r--src/renderergl1/tr_model_iqm.c3
-rw-r--r--src/renderergl2/tr_model_iqm.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/src/renderergl1/tr_model_iqm.c b/src/renderergl1/tr_model_iqm.c
index 7fa4276f..47d618ac 100644
--- a/src/renderergl1/tr_model_iqm.c
+++ b/src/renderergl1/tr_model_iqm.c
@@ -339,6 +339,8 @@ qboolean R_LoadIQM( model_t *mod, void *buffer, int filesize, const char *mod_na
return qfalse;
}
+ joint_names = 0;
+
if ( header->num_joints )
{
// check and swap joints
@@ -347,7 +349,6 @@ qboolean R_LoadIQM( model_t *mod, void *buffer, int filesize, const char *mod_na
return qfalse;
}
joint = (iqmJoint_t *)((byte *)header + header->ofs_joints);
- joint_names = 0;
for( i = 0; i < header->num_joints; i++, joint++ ) {
LL( joint->name );
LL( joint->parent );
diff --git a/src/renderergl2/tr_model_iqm.c b/src/renderergl2/tr_model_iqm.c
index 19cca777..0ea1961d 100644
--- a/src/renderergl2/tr_model_iqm.c
+++ b/src/renderergl2/tr_model_iqm.c
@@ -338,6 +338,8 @@ qboolean R_LoadIQM( model_t *mod, void *buffer, int filesize, const char *mod_na
return qfalse;
}
+ joint_names = 0;
+
if ( header->num_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;
}
joint = (iqmJoint_t *)((byte *)header + header->ofs_joints);
- joint_names = 0;
for( i = 0; i < header->num_joints; i++, joint++ ) {
LL( joint->name );
LL( joint->parent );