[Mesa-dev] [PATCH 4/7] vl/buffer: add sanity check after CALLOC_STRUCT
Emil Velikov
emil.l.velikov at gmail.com
Sat Aug 17 14:51:12 PDT 2013
Check if we have successfully allocated memory.
Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
---
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 9600ce9..22e618a 100644
--- a/src/gallium/auxiliary/vl/vl_video_buffer.c
+++ b/src/gallium/auxiliary/vl/vl_video_buffer.c
@@ -490,6 +490,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;
--
1.8.3.4
More information about the mesa-dev
mailing list