From 5354d2e76a929a2bb898005ef4a19a68580bd922 Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Sat, 17 Aug 2013 21:17:18 +0100 Subject: [PATCH] vl/buffer: add sanity check after CALLOC_STRUCT MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Check if we have successfully allocated memory. Reviewed-by: Christian König Signed-off-by: Emil Velikov --- src/gallium/auxiliary/vl/vl_video_buffer.c | 2 ++ 1 file changed, 2 insertions(+) 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; -- 2.30.2