i965: Avoid segfault in gen6_upload_state
authorCarl Worth <cworth@cworth.org>
Wed, 20 Feb 2013 00:27:16 +0000 (16:27 -0800)
committerCarl Worth <cworth@cworth.org>
Thu, 21 Feb 2013 20:09:24 +0000 (12:09 -0800)
commitf5a8084692a1523f5085a88c22952566506c07de
treebcc8774dce855a7651459faa6249ca31a0419832
parent2e4ef989a2142c9976be6fe0c6fafeb2bdf4e37d
i965: Avoid segfault in gen6_upload_state

This fixes a bug introduced in commit 258453716f001eab1288d99765213 and
triggered whenever "rb" is NULL.

Fixes at least one cause bug #59445:

[SNB/IVB/HSW Bisected]Oglc draw-buffers2(advanced.blending.none) segfault
https://bugs.freedesktop.org/show_bug.cgi?id=59445

(Though segfaults are still possible in that test case, but they have been
present since before commit 258453716f which is what's being fixed here.)

Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/gen6_cc.c