From: Michel Dänzer Date: Tue, 7 Jul 2009 10:17:04 +0000 (+0200) Subject: gallium: Only set FRONT_STATUS_COPY_OF_BACK if there is a back buffer. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=96601ec8e0e35d540c1819a48df7f08ec5874ab7;p=mesa.git gallium: Only set FRONT_STATUS_COPY_OF_BACK if there is a back buffer. Fixes potential crash when SwapBuffers is called but there's no back buffer. --- diff --git a/src/mesa/state_tracker/st_framebuffer.c b/src/mesa/state_tracker/st_framebuffer.c index 33a90ea7db6..fe99fc08926 100644 --- a/src/mesa/state_tracker/st_framebuffer.c +++ b/src/mesa/state_tracker/st_framebuffer.c @@ -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; } }