From 267a7f3eb261f8e9ad63570a2f39e18fc2a91b1c Mon Sep 17 00:00:00 2001 From: enneract Date: Fri, 25 Apr 2014 15:47:45 +0200 Subject: Fix BG_Buildable dereferencing a null pointer if cuboidSize is NULL and buildable is a cuboid. --- src/game/bg_misc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c index ca443f2..ee850d6 100644 --- a/src/game/bg_misc.c +++ b/src/game/bg_misc.c @@ -991,7 +991,7 @@ const buildableAttributes_t *BG_Buildable( buildable_t buildable, const vec3_t c else return &nullBuildable; - if( attr->cuboid ) + if( attr->cuboid && cuboidSize ) { volume = cuboidSize[ 0 ] * cuboidSize[ 1 ] * cuboidSize[ 2 ] * 5.5306341e-5; // NOTE: cubic quake units -> cubic meters ( 1qu = 0.0381m ) memcpy( &cuboidAttr, attr, sizeof( buildableAttributes_t ) ); -- cgit