From: Juha-Pekka Heikkila Date: Thu, 8 May 2014 07:34:50 +0000 (+0300) Subject: mesa/main: Verify calloc return value in register_surface() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cc5abf046050b2a25c5f4966662d3388302b3cf2;p=mesa.git mesa/main: Verify calloc return value in register_surface() Signed-off-by: Juha-Pekka Heikkila Reviewed-by: Ian Romanick --- diff --git a/src/mesa/main/vdpau.c b/src/mesa/main/vdpau.c index d9745939391..f1b3eceee31 100644 --- a/src/mesa/main/vdpau.c +++ b/src/mesa/main/vdpau.c @@ -132,6 +132,11 @@ register_surface(struct gl_context *ctx, GLboolean isOutput, } surf = CALLOC_STRUCT( vdp_surface ); + if (surf == NULL) { + _mesa_error_no_memory("VDPAURegisterSurfaceNV"); + return (GLintptr)NULL; + } + surf->vdpSurface = vdpSurface; surf->target = target; surf->access = GL_READ_WRITE;