From ce526de6ffea41d70f6efb6608ffe308028cb47b Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 13 Nov 2006 22:51:11 +0000 Subject: tdfxDDWriteDepthPixels can be called with mask == NULL. Via depth_test_pixels (swrast/s_depth.c), tdfxDDWriteDepthPixels can be called with mask == NULL. Test for this condition in the places where mask might be dereference. This matches the behavior of several other functions in this file with a 'const GLubyte mask[]' parameter. --- src/mesa/drivers/dri/tdfx/tdfx_span.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa/drivers/dri/tdfx') diff --git a/src/mesa/drivers/dri/tdfx/tdfx_span.c b/src/mesa/drivers/dri/tdfx/tdfx_span.c index ce895f82542..ee5eb459bee 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_span.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_span.c @@ -976,7 +976,7 @@ tdfxDDWriteDepthPixels(GLcontext * ctx, struct gl_renderbuffer *rb, GetFbParams(fxMesa, &info, &backBufferInfo, &ReadParams, sizeof(GLushort)); for (i = 0; i < n; i++) { - if (mask[i] && visible_pixel(fxMesa, x[i], y[i])) { + if ((!mask || mask[i]) && visible_pixel(fxMesa, x[i], y[i])) { xpos = x[i] + fxMesa->x_offset; ypos = bottom - y[i]; d16 = depth[i]; @@ -1000,7 +1000,7 @@ tdfxDDWriteDepthPixels(GLcontext * ctx, struct gl_renderbuffer *rb, GetFbParams(fxMesa, &info, &backBufferInfo, &ReadParams, sizeof(GLuint)); for (i = 0; i < n; i++) { - if (mask[i]) { + if (!mask || mask[i]) { if (visible_pixel(fxMesa, x[i], y[i])) { xpos = x[i] + fxMesa->x_offset; ypos = bottom - y[i]; -- cgit v1.2.3