add some rb->Data null ptr checks (bug 7205)
authorBrian <brian@yutani.localnet.net>
Thu, 15 Mar 2007 17:11:41 +0000 (11:11 -0600)
committerBrian <brian@yutani.localnet.net>
Thu, 15 Mar 2007 17:11:41 +0000 (11:11 -0600)
src/mesa/swrast/s_accum.c
src/mesa/swrast/s_depth.c
src/mesa/swrast/s_stencil.c

index 69e9404c55cc217b9cc44b2c4e3e895596daaabd..f53e7f52c5e919f242368f304163c1ac7dc9209e 100644 (file)
@@ -136,7 +136,9 @@ _swrast_clear_accum_buffer( GLcontext *ctx, struct gl_renderbuffer *rb )
       return;
    }
 
-   assert(rb);
+   if (!rb || !rb->Data)
+      return;
+
    assert(rb->_BaseFormat == GL_RGBA);
    /* add other types in future? */
    assert(rb->DataType == GL_SHORT || rb->DataType == GL_UNSIGNED_SHORT);
index 408174c990fb165941a8ee0df4015852e42347b5..dde2b1db83a9b020564cecdce732499ac3268f3d 100644 (file)
@@ -1350,7 +1350,7 @@ _swrast_clear_depth_buffer( GLcontext *ctx, struct gl_renderbuffer *rb )
    GLuint clearValue;
    GLint x, y, width, height;
 
-   if (!rb || !ctx->Depth.Mask) {
+   if (!rb || !ctx->Depth.Mask || !rb->Data) {
       /* no depth buffer, or writing to it is disabled */
       return;
    }
index a8aa1d4b6dc26b805008d69692e85075b53988c1..43475c0e816e8dabcb8c0fbbb589225ccc1b7bf1 100644 (file)
@@ -1154,7 +1154,7 @@ _swrast_clear_stencil_buffer( GLcontext *ctx, struct gl_renderbuffer *rb )
    const GLuint stencilMax = (1 << stencilBits) - 1;
    GLint x, y, width, height;
 
-   if (!rb || mask == 0)
+   if (!rb || mask == 0 || !rb->Data)
       return;
 
    ASSERT(rb->DataType == GL_UNSIGNED_BYTE ||