Module: Mesa Branch: master Commit: 2c34b49d9e2fe03376385199ef76915884ffd962 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=2c34b49d9e2fe03376385199ef76915884ffd962
Author: Timothy Arceri <[email protected]> Date: Thu Jul 27 08:53:08 2017 +1000 mesa: check that buffer object is not NULL before initializing it Reviewed-by: Samuel Pitoiset <[email protected]> --- 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 cb666dcf13..cd561a0a27 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; } _______________________________________________ mesa-commit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-commit
