Skip to content

Commit 85f3584

Browse files
committed
lerptag: Ensure we never return uninitialized data
If for any reason, we fail to find a tag for iqm/md5 code, if the attachment is uninitialized like in the entity cache code, we will return NaNs. Fixes this crash for me: ``` tuple=...) at /mnt/media/code/unv-master/daemon/src/common/Util.h:136 at /mnt/media/code/unv-master/daemon/src/common/Util.h:141 ```
1 parent 2e5b685 commit 85f3584

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/engine/renderer/tr_model.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,9 @@ int RE_LerpTagET( orientation_t* tag, const trRefEntity_t* ent, const char* tagN
442442
float frontLerp = frac;
443443
float backLerp = 1.0f - frac;
444444

445+
AxisClear( tag->axis );
446+
VectorClear( tag->origin );
447+
445448
if ( model->type == modtype_t::MOD_MD5 || model->type == modtype_t::MOD_IQM )
446449
{
447450
vec3_t tmp;
@@ -476,8 +479,6 @@ int RE_LerpTagET( orientation_t* tag, const trRefEntity_t* ent, const char* tagN
476479

477480
if ( !start || !end )
478481
{
479-
AxisClear( tag->axis );
480-
VectorClear( tag->origin );
481482
return -1;
482483
}
483484

0 commit comments

Comments
 (0)