[Mesa-dev] [PATCH 5/9] svga: Handle null buffers in svga_buffer_is_user_buffer().

Thomas Hellstrom thellstrom at vmware.com
Thu Jun 30 00:29:33 PDT 2011


From: José Fonseca <jfonseca at vmware.com>

---
 src/gallium/drivers/svga/svga_resource_buffer.h |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/svga/svga_resource_buffer.h b/src/gallium/drivers/svga/svga_resource_buffer.h
index 2ae44d2..69d6f72 100644
--- a/src/gallium/drivers/svga/svga_resource_buffer.h
+++ b/src/gallium/drivers/svga/svga_resource_buffer.h
@@ -200,7 +200,11 @@ svga_buffer(struct pipe_resource *buffer)
 static INLINE boolean 
 svga_buffer_is_user_buffer( struct pipe_resource *buffer )
 {
-   return svga_buffer(buffer)->user;
+   if (buffer) {
+      return svga_buffer(buffer)->user;
+   } else {
+      return FALSE;
+   }
 }
 
 
-- 
1.6.2.5



More information about the mesa-dev mailing list