mesa: check that buffer object is not NULL before initializing it

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
This commit is contained in:
Timothy Arceri
2017-07-27 08:53:08 +10:00
parent 6ee3323d7d
commit 2c34b49d9e
+3 -4
View File
@@ -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;
struct gl_buffer_object *obj = MALLOC_STRUCT(gl_buffer_object);
if (!obj)
return NULL;
(void) ctx;
obj = MALLOC_STRUCT(gl_buffer_object);
_mesa_initialize_buffer_object(ctx, obj, name);
return obj;
}