r300: move pointer dereference after a NULL check
authorPavel Ondračka <pavel.ondracka@gmail.com>
Sun, 10 Apr 2022 16:57:56 +0000 (18:57 +0200)
committerMarge Bot <emma+marge@anholt.net>
Mon, 11 Apr 2022 20:48:11 +0000 (20:48 +0000)
commitef2b8f56b13c7696b6c0047e3bbf2939390e1b75
tree8c6be3938a007de37a88830ff3551ef6c81065a5
parent2149f12c1e79a6bf3ed54203b7013c7bef7696a2
r300: move pointer dereference after a NULL check

Vs state can be NULL by the time r300_set_constant_buffer is called.
We don't hit this with OpenGL though, so this is why I didn't spot
this in my testing, but nine hits this codepath. Restore the original
behavior here.

Fixes: 882811b1ff67fa37197e27f56caaffbe3e6164d6
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15842>
src/gallium/drivers/r300/r300_state.c