mesa/main: Verify calloc return value in register_surface()

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
Juha-Pekka Heikkila
2014-05-08 10:34:50 +03:00
committed by Ville Syrjälä
parent 568c545b7e
commit cc5abf0460
+5
View File
@@ -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;