]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
ensure texture is not null before adjusting bind counter
authoreihrul <eihrul@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 30 Jan 2012 21:50:20 +0000 (21:50 +0000)
committereihrul <eihrul@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 30 Jan 2012 21:50:20 +0000 (21:50 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11663 d7cf8633-e32d-0410-b094-e92efae38249

dpsoftrast.c

index a646db35bd13d32da8f143f7d5b75f028e8ca292..b57129c1c9d1fac110198bc5d5e48444e9baa475 100644 (file)
@@ -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)