summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/vdpau/surface.c
diff options
context:
space:
mode:
authorThomas Hindoe Paaboel Andersen <[email protected]>2016-03-30 08:13:24 +0200
committerChristian König <[email protected]>2016-03-30 20:00:27 +0200
commit9a73f5728e9b834c51128e34317854702281bf3e (patch)
treeafa048cfa3aba0e8648cff82f1ae28dc6fe1409c /src/gallium/state_trackers/vdpau/surface.c
parent4541a785020aa6b9c6472d0fc4fb0fe8cdcec40f (diff)
st/vdpau: correct null check
The null check of result was the wrong way around. Also, move memset and dereference of result after the null check. Reviewed-by: Christian König <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/vdpau/surface.c')
-rw-r--r--src/gallium/state_trackers/vdpau/surface.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gallium/state_trackers/vdpau/surface.c b/src/gallium/state_trackers/vdpau/surface.c
index 0550141b597..d418d56a26a 100644
--- a/src/gallium/state_trackers/vdpau/surface.c
+++ b/src/gallium/state_trackers/vdpau/surface.c
@@ -426,18 +426,18 @@ VdpStatus vlVdpVideoSurfaceDMABuf(VdpVideoSurface surface,
struct pipe_surface *surf;
- memset(result, 0, sizeof(*result));
- result->handle = -1;
-
if (!p_surf)
return VDP_STATUS_INVALID_HANDLE;
if (plane > 3)
return VDP_STATUS_INVALID_VALUE;
- if (result)
+ if (!result)
return VDP_STATUS_INVALID_POINTER;
+ memset(result, 0, sizeof(*result));
+ result->handle = -1;
+
pipe_mutex_lock(p_surf->device->mutex);
if (p_surf->video_buffer == NULL) {
struct pipe_context *pipe = p_surf->device->context;