st/vdpau: check for null pointer in get/put bits.

Check for null pointer before accessing arrays in get/put bits
native/YCbCr/Indexed in VdpOutputSurface and VdpVideoSurface.

Signed-off-by: Nayan Deshmukh <nayan26deshmukh@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
This commit is contained in:
Nayan Deshmukh
2016-06-02 12:11:58 +05:30
committed by Christian König
parent b3e75c3997
commit 6c9a352d79
2 changed files with 12 additions and 0 deletions

View File

@@ -205,6 +205,9 @@ vlVdpOutputSurfaceGetBitsNative(VdpOutputSurface surface,
if (!pipe)
return VDP_STATUS_INVALID_HANDLE;
if (!destination_data || !destination_pitches)
return VDP_STATUS_INVALID_POINTER;
pipe_mutex_lock(vlsurface->device->mutex);
vlVdpResolveDelayedRendering(vlsurface->device, NULL, NULL);
@@ -247,6 +250,9 @@ vlVdpOutputSurfacePutBitsNative(VdpOutputSurface surface,
if (!pipe)
return VDP_STATUS_INVALID_HANDLE;
if (!source_data || !source_pitches)
return VDP_STATUS_INVALID_POINTER;
pipe_mutex_lock(vlsurface->device->mutex);
vlVdpResolveDelayedRendering(vlsurface->device, NULL, NULL);

View File

@@ -215,6 +215,9 @@ vlVdpVideoSurfaceGetBitsYCbCr(VdpVideoSurface surface,
if (!pipe)
return VDP_STATUS_INVALID_HANDLE;
if (!destination_data || !destination_pitches)
return VDP_STATUS_INVALID_POINTER;
format = FormatYCBCRToPipe(destination_ycbcr_format);
if (format == PIPE_FORMAT_NONE)
return VDP_STATUS_INVALID_Y_CB_CR_FORMAT;
@@ -313,6 +316,9 @@ vlVdpVideoSurfacePutBitsYCbCr(VdpVideoSurface surface,
if (!pipe)
return VDP_STATUS_INVALID_HANDLE;
if (!source_data || !source_pitches)
return VDP_STATUS_INVALID_POINTER;
pipe_mutex_lock(p_surf->device->mutex);
if (p_surf->video_buffer == NULL || pformat != p_surf->video_buffer->buffer_format) {