From 22d615a9c4b95c528d6604eccb71cf6fe5193d5a Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Mon, 11 Jan 2010 20:27:54 -0800 Subject: [PATCH] r300g: Avoid segfault on binding null RS state. --- src/gallium/drivers/r300/r300_state.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; -- 2.30.2