From 98dda7758f0ff9a2f6d9a2fe516faf1724efe6e1 Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Mon, 18 Mar 2013 15:55:25 -0500 Subject: [PATCH] Always initialize joint_names in R_LoadIQM Reported by MAN-AT-ARMS --- code/renderergl1/tr_model_iqm.c | 3 ++- code/renderergl2/tr_model_iqm.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/code/renderergl1/tr_model_iqm.c b/code/renderergl1/tr_model_iqm.c index b42b9a0b..db089da7 100644 --- a/code/renderergl1/tr_model_iqm.c +++ b/code/renderergl1/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 ); diff --git a/code/renderergl2/tr_model_iqm.c b/code/renderergl2/tr_model_iqm.c index efda94ff..cee51a18 100644 --- a/code/renderergl2/tr_model_iqm.c +++ b/code/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 );