r300g: Avoid segfault on binding null RS state.
authorCorbin Simpson <MostAwesomeDude@gmail.com>
Tue, 12 Jan 2010 04:27:54 +0000 (20:27 -0800)
committerCorbin Simpson <MostAwesomeDude@gmail.com>
Tue, 12 Jan 2010 04:54:11 +0000 (20:54 -0800)
src/gallium/drivers/r300/r300_state.c

index 78764ddc98e74f8e6a6e91699cc01bfb7ce8f9cf..4c22d4ebc45bf5bf41dbe14a26c4d1ca14cfa158 100644 (file)
@@ -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;