summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/vdpau/surface.c
diff options
context:
space:
mode:
authorNayan Deshmukh <[email protected]>2016-06-02 12:11:58 +0530
committerChristian König <[email protected]>2016-06-02 09:28:48 +0200
commit6c9a352d79e215b545b5d400ae946a27d56e4abd (patch)
tree5bd985195ca158ff80cfbaf15cf660d7dcc7bd0f /src/gallium/state_trackers/vdpau/surface.c
parentb3e75c39976c03f73128ffd802465799ac0e4ef5 (diff)
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 <[email protected]> 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.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/vdpau/surface.c b/src/gallium/state_trackers/vdpau/surface.c
index d418d56a26a..7998527b2d1 100644
--- a/src/gallium/state_trackers/vdpau/surface.c
+++ b/src/gallium/state_trackers/vdpau/surface.c
@@ -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) {