gallium: Only set FRONT_STATUS_COPY_OF_BACK if there is a back buffer.
authorMichel Dänzer <daenzer@vmware.com>
Tue, 7 Jul 2009 10:17:04 +0000 (12:17 +0200)
committerMichel Dänzer <daenzer@vmware.com>
Tue, 7 Jul 2009 10:17:04 +0000 (12:17 +0200)
Fixes potential crash when SwapBuffers is called but there's no back buffer.

src/mesa/state_tracker/st_framebuffer.c

index 33a90ea7db605edf23327e63d2ba4e696fd7b528..fe99fc08926c9e2f7df5fd6d2953cee957528513 100644 (file)
@@ -280,7 +280,8 @@ st_notify_swapbuffers(struct st_framebuffer *stfb)
                PIPE_FLUSH_SWAPBUFFERS |
                PIPE_FLUSH_FRAME,
                 NULL );
-      ctx->st->frontbuffer_status = FRONT_STATUS_COPY_OF_BACK;
+      if (st_renderbuffer(stfb->Base.Attachment[BUFFER_BACK_LEFT].Renderbuffer))
+         ctx->st->frontbuffer_status = FRONT_STATUS_COPY_OF_BACK;
    }
 }