From 1ecaedbfab3f26a77bd421bcb0db4458cc9645af Mon Sep 17 00:00:00 2001 From: eihrul Date: Mon, 30 Jan 2012 21:50:20 +0000 Subject: [PATCH] ensure texture is not null before adjusting bind counter git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11663 d7cf8633-e32d-0410-b094-e92efae38249 --- dpsoftrast.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dpsoftrast.c b/dpsoftrast.c index a646db35..b57129c1 100644 --- a/dpsoftrast.c +++ b/dpsoftrast.c @@ -1314,7 +1314,8 @@ void DPSOFTRAST_SetTexture(int unitnum, int index) command->texture = texture; dpsoftrast.texbound[unitnum] = texture; - ATOMIC_ADD(texture->binds, dpsoftrast.numthreads); + if (texture) + ATOMIC_ADD(texture->binds, dpsoftrast.numthreads); } void DPSOFTRAST_SetVertexPointer(const float *vertex3f, size_t stride) -- 2.39.2