summaryrefslogtreecommitdiff
path: root/src/mesa/swrast/s_drawpix.c
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2008-01-22 21:11:55 -0700
committerBrian <brian.paul@tungstengraphics.com>2008-01-22 21:11:55 -0700
commit2a077500a84819d1e6ac62e84ded130aa655c5e9 (patch)
treee16cbba8051acc5ee5fc4409e5697e11d0041989 /src/mesa/swrast/s_drawpix.c
parente1ae5b89fce51ce1138a5cbe93caa0e1fccf219f (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.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c
index 7bab14f200..4733d10bb5 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 ||