summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmil Velikov <[email protected]>2013-08-17 21:17:18 +0100
committerChristian König <[email protected]>2013-08-19 18:32:08 +0200
commit5354d2e76a929a2bb898005ef4a19a68580bd922 (patch)
tree0fd924287cde7f10ff45adbb0598be85416f3949
parenteab9bad1ac0e0ba625b750ee2fbe557beb336766 (diff)
vl/buffer: add sanity check after CALLOC_STRUCT
Check if we have successfully allocated memory. Reviewed-by: Christian König <[email protected]> Signed-off-by: Emil Velikov <[email protected]>
-rw-r--r--src/gallium/auxiliary/vl/vl_video_buffer.c2
1 files changed, 2 insertions, 0 deletions
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;