check for NULL swrast->Driver.SetBuffer before calling it
authorBrian Paul <brian.paul@tungstengraphics.com>
Tue, 21 Jun 2005 14:39:43 +0000 (14:39 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Tue, 21 Jun 2005 14:39:43 +0000 (14:39 +0000)
src/mesa/swrast/s_buffers.c
src/mesa/swrast/s_span.c

index 7f95ed5ec56804642cb53d76d6b9c63629111c0a..e7889008972c34803f08117afd873407c9adc436 100644 (file)
@@ -236,8 +236,9 @@ clear_color_buffers(GLcontext *ctx)
       struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0][i];
 #if OLD_RENDERBUFFER || NEW_RENDERBUFFER
       /* SetBuffer will go away */
-      swrast->Driver.SetBuffer(ctx, ctx->DrawBuffer,
-                               ctx->DrawBuffer->_ColorDrawBit[0][i]);
+      if (swrast->Driver.SetBuffer)
+         swrast->Driver.SetBuffer(ctx, ctx->DrawBuffer,
+                                  ctx->DrawBuffer->_ColorDrawBit[0][i]);
 #endif
 
       if (ctx->Visual.rgbMode) {
@@ -357,7 +358,8 @@ _swrast_use_read_buffer( GLcontext *ctx )
    /* Do this so the software-emulated alpha plane span functions work! */
    swrast->CurrentBufferBit = ctx->ReadBuffer->_ColorReadBufferMask;
    /* Tell the device driver where to read/write spans */
-   swrast->Driver.SetBuffer(ctx, ctx->ReadBuffer, swrast->CurrentBufferBit);
+   if (swrast->Driver.SetBuffer)
+      swrast->Driver.SetBuffer(ctx, ctx->ReadBuffer, swrast->CurrentBufferBit);
 }
 
 
index 86ae136562bcc33d504d4b52f0cb99e76916b25f..3a6e7195b1bc63729d21bda1c335e9a6beee111b 100644 (file)
@@ -1053,7 +1053,8 @@ multi_write_rgba_span( GLcontext *ctx, struct sw_span *span )
       GLuint bufferBit = fb->_ColorDrawBit[output][i];
       /* Set the current read/draw buffer */
       swrast->CurrentBufferBit = bufferBit;
-      (*swrast->Driver.SetBuffer)(ctx, ctx->DrawBuffer, bufferBit);
+      if (swrast->Driver.SetBuffer)
+         (*swrast->Driver.SetBuffer)(ctx, ctx->DrawBuffer, bufferBit);
 #endif
 
       /* make copy of incoming colors */