From: Maciej Cencora Date: Tue, 9 Mar 2010 22:13:19 +0000 (+0100) Subject: r300: don't crash if there's no colorbuffer X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=eeaf1e0519912b2ca3a8bce56c35548f9e0b73ca;p=mesa.git r300: don't crash if there's no colorbuffer --- diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index bdd12c6d220..87489412419 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -2245,8 +2245,13 @@ static void r300SetupUsOutputFormat(GLcontext *ctx) { r300ContextPtr rmesa = R300_CONTEXT(ctx); uint32_t hw_format; + struct radeon_renderbuffer *rrb = radeon_get_colorbuffer(&rmesa->radeon); - switch (radeon_get_colorbuffer(&rmesa->radeon)->base.Format) + if (!rrb) { + return; + } + + switch (rrb->base.Format) { case MESA_FORMAT_RGBA5551: case MESA_FORMAT_RGBA8888: