summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/bufferobj.h
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2011-11-23 15:33:46 -0700
committerBrian Paul <[email protected]>2011-11-28 08:07:32 -0700
commit56b870e44106188f425df6eb45b7a394f0420e5e (patch)
treeda0df4d7f7b3f3b2b9cf2d028e95040e6626475e /src/mesa/main/bufferobj.h
parent37bf720da4a165c3fbf22d8ebb87c5c42e02f98e (diff)
mesa: check for null ptr in _mesa_is_bufferobj()
This simplifies a few callers. And it adds a bit of robustness. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Yuanhan Liu <[email protected]>
Diffstat (limited to 'src/mesa/main/bufferobj.h')
-rw-r--r--src/mesa/main/bufferobj.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mesa/main/bufferobj.h b/src/mesa/main/bufferobj.h
index b4e70f2f08a..c0d5a641a46 100644
--- a/src/mesa/main/bufferobj.h
+++ b/src/mesa/main/bufferobj.h
@@ -53,7 +53,7 @@ _mesa_bufferobj_mapped(const struct gl_buffer_object *obj)
static inline GLboolean
_mesa_is_bufferobj(const struct gl_buffer_object *obj)
{
- return obj->Name != 0;
+ return obj != NULL && obj->Name != 0;
}