diff options
author | Brian <[email protected]> | 2008-01-22 21:11:55 -0700 |
---|---|---|
committer | Brian <[email protected]> | 2008-01-22 21:11:55 -0700 |
commit | 2a077500a84819d1e6ac62e84ded130aa655c5e9 (patch) | |
tree | e16cbba8051acc5ee5fc4409e5697e11d0041989 /src/mesa/swrast/s_drawpix.c | |
parent | e1ae5b89fce51ce1138a5cbe93caa0e1fccf219f (diff) |
Fix some issues with glDrawBuffer(GL_NONE), bug 14198
Set _ColorDrawBuffers[0] = NULL if no renderbuffers enabled.
Check that _ColorDrawBuffers[0] is non-null before dereferencing in a few places.
Diffstat (limited to 'src/mesa/swrast/s_drawpix.c')
-rw-r--r-- | src/mesa/swrast/s_drawpix.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c index 7bab14f200e..4733d10bb59 100644 --- a/src/mesa/swrast/s_drawpix.c +++ b/src/mesa/swrast/s_drawpix.c @@ -54,7 +54,7 @@ fast_draw_rgba_pixels(GLcontext *ctx, GLint x, GLint y, { const GLint imgX = x, imgY = y; struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0]; - const GLenum rbType = rb->DataType; + GLenum rbType; SWcontext *swrast = SWRAST_CONTEXT(ctx); SWspan span; GLboolean simpleZoom; @@ -62,6 +62,11 @@ fast_draw_rgba_pixels(GLcontext *ctx, GLint x, GLint y, struct gl_pixelstore_attrib unpack; GLint destX, destY, drawWidth, drawHeight; /* post clipping */ + if (!rb) + return GL_TRUE; /* no-op */ + + rbType = rb->DataType; + if ((swrast->_RasterMask & ~CLIP_BIT) || ctx->Texture._EnabledCoordUnits || userUnpack->SwapBytes || |