From: Emil Velikov Date: Sat, 17 Aug 2013 20:17:18 +0000 (+0100) Subject: vl/buffer: add sanity check after CALLOC_STRUCT X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5354d2e76a929a2bb898005ef4a19a68580bd922;p=mesa.git vl/buffer: add sanity check after CALLOC_STRUCT Check if we have successfully allocated memory. Reviewed-by: Christian König Signed-off-by: Emil Velikov --- diff --git a/src/gallium/auxiliary/vl/vl_video_buffer.c b/src/gallium/auxiliary/vl/vl_video_buffer.c index 3b599fcd12f..e2cac0a654b 100644 --- a/src/gallium/auxiliary/vl/vl_video_buffer.c +++ b/src/gallium/auxiliary/vl/vl_video_buffer.c @@ -492,6 +492,8 @@ vl_video_buffer_create_ex2(struct pipe_context *pipe, unsigned i; buffer = CALLOC_STRUCT(vl_video_buffer); + if (!buffer) + return NULL; buffer->base = *tmpl; buffer->base.context = pipe;