From: havoc Date: Tue, 16 Nov 2004 12:14:51 +0000 (+0000) Subject: now checks that a lightmap surfacechain is not NULL before dereferencing it X-Git-Tag: xonotic-v0.1.0preview~5378 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8a95a8af808dfad9de9252f939c7142cb2c58750;p=xonotic%2Fdarkplaces.git now checks that a lightmap surfacechain is not NULL before dereferencing it git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4757 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/gl_rsurf.c b/gl_rsurf.c index f8909668..72d39741 100644 --- a/gl_rsurf.c +++ b/gl_rsurf.c @@ -1299,8 +1299,9 @@ void R_UpdateLightmapInfo(entity_render_t *ent) if (model->brushq1.light_stylevalue[i] != d_lightstylevalue[model->brushq1.light_style[i]]) { model->brushq1.light_stylevalue[i] = d_lightstylevalue[model->brushq1.light_style[i]]; - for (surfacechain = model->brushq1.light_styleupdatechains[i];(surface = *surfacechain);surfacechain++) - surface->cached_dlight = true; + if ((surfacechain = model->brushq1.light_styleupdatechains[i])) + for (;(surface = *surfacechain);surfacechain++) + surface->cached_dlight = true; } } }