]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - dpsoftrast.c
ensure texture is not null before adjusting bind counter
[xonotic/darkplaces.git] / 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)