mesa: Branch 'master'

Brian Paul brianp at kemper.freedesktop.org
Thu Mar 15 17:11:47 UTC 2007


 src/mesa/swrast/s_accum.c   |    4 +++-
 src/mesa/swrast/s_depth.c   |    2 +-
 src/mesa/swrast/s_stencil.c |    2 +-
 3 files changed, 5 insertions(+), 3 deletions(-)

New commits:
diff-tree 038e981cacdc6f32588442666cde8a8fc16cfdfc (from 90563d39cbdae552f498285125381c8c8ccb2f83)
Author: Brian <brian at yutani.localnet.net>
Date:   Thu Mar 15 11:11:41 2007 -0600

    add some rb->Data null ptr checks (bug 7205)

diff --git a/src/mesa/swrast/s_accum.c b/src/mesa/swrast/s_accum.c
index 69e9404..f53e7f5 100644
--- a/src/mesa/swrast/s_accum.c
+++ b/src/mesa/swrast/s_accum.c
@@ -136,7 +136,9 @@ _swrast_clear_accum_buffer( GLcontext *c
       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);
diff --git a/src/mesa/swrast/s_depth.c b/src/mesa/swrast/s_depth.c
index 408174c..dde2b1d 100644
--- a/src/mesa/swrast/s_depth.c
+++ b/src/mesa/swrast/s_depth.c
@@ -1350,7 +1350,7 @@ _swrast_clear_depth_buffer( GLcontext *c
    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;
    }
diff --git a/src/mesa/swrast/s_stencil.c b/src/mesa/swrast/s_stencil.c
index a8aa1d4..43475c0 100644
--- a/src/mesa/swrast/s_stencil.c
+++ b/src/mesa/swrast/s_stencil.c
@@ -1154,7 +1154,7 @@ _swrast_clear_stencil_buffer( GLcontext 
    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 ||



More information about the mesa-commit mailing list