[Mesa-dev] [PATCH] mesa: check that buffer object is not NULL before initializing it
Timothy Arceri
tarceri at itsqueeze.com
Wed Jul 26 22:54:12 UTC 2017
Cc: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
src/mesa/main/bufferobj.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index 720569d..2660e13 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -443,11 +443,10 @@ convert_clear_buffer_data(struct gl_context *ctx,
static struct gl_buffer_object *
_mesa_new_buffer_object(struct gl_context *ctx, GLuint name)
{
- struct gl_buffer_object *obj;
-
- (void) ctx;
+ struct gl_buffer_object *obj = MALLOC_STRUCT(gl_buffer_object);
+ if (!obj)
+ return NULL;
- obj = MALLOC_STRUCT(gl_buffer_object);
_mesa_initialize_buffer_object(ctx, obj, name);
return obj;
}
--
2.9.4
More information about the mesa-dev
mailing list