diff options
author | Emil Velikov <[email protected]> | 2013-08-17 21:45:19 +0100 |
---|---|---|
committer | Christian König <[email protected]> | 2013-08-19 18:32:07 +0200 |
commit | eab9bad1ac0e0ba625b750ee2fbe557beb336766 (patch) | |
tree | 43de7a7601e000fc9d8bf7ce4f1c1b3ee93b11c4 /src/gallium/state_trackers | |
parent | 5e91c152902dc32b9042faddf186146860095ecb (diff) |
st/xvmc: exit gracefully if we fail to create video buffer
Free any allocated memory and return BadAlloc if create_video_buffer()
has failed to create a buffer.
Reviewed-by: Christian König <[email protected]>
Signed-off-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r-- | src/gallium/state_trackers/xvmc/surface.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/xvmc/surface.c b/src/gallium/state_trackers/xvmc/surface.c index 2e67612f690..13f337c61cd 100644 --- a/src/gallium/state_trackers/xvmc/surface.c +++ b/src/gallium/state_trackers/xvmc/surface.c @@ -193,6 +193,10 @@ Status XvMCCreateSurface(Display *dpy, XvMCContext *context, XvMCSurface *surfac ); surface_priv->video_buffer = pipe->create_video_buffer(pipe, &tmpl); + if (!surface_priv->video_buffer) { + FREE(surface_priv); + return BadAlloc; + } surface_priv->context = context; surface->surface_id = XAllocID(dpy); |