From 8a95a8af808dfad9de9252f939c7142cb2c58750 Mon Sep 17 00:00:00 2001 From: havoc Date: Tue, 16 Nov 2004 12:14:51 +0000 Subject: [PATCH] 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 --- gl_rsurf.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; } } } -- 2.39.2