[Mesa-dev] [PATCH] mesa: check that buffer object is not NULL before initializing it

Samuel Pitoiset samuel.pitoiset at gmail.com
Thu Jul 27 07:56:37 UTC 2017


Looks good, thanks. :)

Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>

On 07/27/2017 12:54 AM, Timothy Arceri wrote:
> 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;
>   }
> 


More information about the mesa-dev mailing list