summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/vdpau
diff options
context:
space:
mode:
authorThomas Hindoe Paaboel Andersen <phomes@gmail.com>2016-03-30 08:13:24 +0200
committerChristian König <christian.koenig@amd.com>2016-03-30 20:00:27 +0200
commit9a73f5728e9b834c51128e34317854702281bf3e (patch)
treeafa048cfa3aba0e8648cff82f1ae28dc6fe1409c /src/gallium/state_trackers/vdpau
parent4541a785020aa6b9c6472d0fc4fb0fe8cdcec40f (diff)
downloadexternal_mesa3d-9a73f5728e9b834c51128e34317854702281bf3e.zip
external_mesa3d-9a73f5728e9b834c51128e34317854702281bf3e.tar.gz
external_mesa3d-9a73f5728e9b834c51128e34317854702281bf3e.tar.bz2
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 <christian.koenig@amd.com>
Diffstat (limited to 'src/gallium/state_trackers/vdpau')
-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 0550141..d418d56 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;