[Nouveau] [PATCH 2/3] nv30: Avoid Null-pointer deref with possible empty vtxbuf

Roy Spliet r.spliet at student.tudelft.nl
Wed May 16 02:06:47 PDT 2012


Signed-off-by: Roy Spliet <r.spliet at student.tudelft.nl>
---
 src/gallium/drivers/nv30/nv30_vbo.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/nv30/nv30_vbo.c b/src/gallium/drivers/nv30/nv30_vbo.c
index 43914f7..db25991 100644
--- a/src/gallium/drivers/nv30/nv30_vbo.c
+++ b/src/gallium/drivers/nv30/nv30_vbo.c
@@ -104,7 +104,7 @@ nv30_prevalidate_vbufs(struct nv30_context *nv30)
       buf = nv04_resource(vb->buffer);
 
       /* NOTE: user buffers with temporary storage count as mapped by GPU */
-      if (!nouveau_resource_mapped_by_gpu(vb->buffer)) {
+      if (buf && !nouveau_resource_mapped_by_gpu(vb->buffer)) {
          if (nv30->vbo_push_hint) {
             nv30->vbo_fifo = ~0;
             continue;
-- 
1.7.7.6



More information about the Nouveau mailing list