mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 02:38:04 +02:00
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>
This commit is contained in:
parent
4541a78502
commit
9a73f5728e
1 changed files with 4 additions and 4 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue