nv50: avoid segfault with enabled but unbound vertex attrib
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 6 Jul 2015 21:34:23 +0000 (23:34 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 8 Jul 2015 19:03:23 +0000 (21:03 +0200)
commitadc816a1e41812e6489a5bc388f80de65504be5b
tree9377357f359f4d9687ad909f433df003e7e6fa71
parentec151e2f72bd4a239573770aea563d47d0268708
nv50: avoid segfault with enabled but unbound vertex attrib

Before validating vertex arrays we need to check if a VBO is present.
Checking if vb->buffer is not NULL fixes the issue.

Fixes the following piglit test:
  gl-3.1-vao-broken-attrib

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/nouveau/nv50/nv50_vbo.c