From: Corbin Simpson Date: Tue, 12 Jan 2010 04:27:54 +0000 (-0800) Subject: r300g: Avoid segfault on binding null RS state. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=22d615a9c4b95c528d6604eccb71cf6fe5193d5a;p=mesa.git r300g: Avoid segfault on binding null RS state. --- diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 78764ddc98e..4c22d4ebc45 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -717,7 +717,11 @@ static void r300_bind_rs_state(struct pipe_context* pipe, void* state) draw_set_rasterizer_state(r300->draw, &rs->rs); } - r300->tcl_bypass = rs->rs.bypass_vs_clip_and_viewport; + if (rs) { + r300->tcl_bypass = rs->rs.bypass_vs_clip_and_viewport; + } else { + r300->tcl_bypass = FALSE; + } r300->rs_state.state = rs; r300->rs_state.dirty = TRUE;