diff options
author | Gurkirpal Singh <[email protected]> | 2016-06-26 12:32:25 +0530 |
---|---|---|
committer | Julien Isorce <[email protected]> | 2016-06-27 08:09:08 +0100 |
commit | 46dba701d81199e6450dc50ef3f0ff476dbfb17f (patch) | |
tree | 2c39f50d8138c6e167a6527137dedfefb2884778 /src/gallium/state_trackers/va | |
parent | d20b89e9281d6d1ccf56a4eb743dc783fce2fc51 (diff) |
st/va: Check NULL pointer
Call to handle_table_get in vlVaDestroySurfaces can
return NULL on failure.
CID: 1243522
Signed-off-by: Gurkirpal Singh <[email protected]>
Reviewed-by: Julien Isorce <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/va')
-rw-r--r-- | src/gallium/state_trackers/va/surface.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/va/surface.c b/src/gallium/state_trackers/va/surface.c index 5efb8934c5c..3e74353f6de 100644 --- a/src/gallium/state_trackers/va/surface.c +++ b/src/gallium/state_trackers/va/surface.c @@ -71,6 +71,10 @@ vlVaDestroySurfaces(VADriverContextP ctx, VASurfaceID *surface_list, int num_sur pipe_mutex_lock(drv->mutex); for (i = 0; i < num_surfaces; ++i) { vlVaSurface *surf = handle_table_get(drv->htab, surface_list[i]); + if (!surf) { + pipe_mutex_unlock(drv->mutex); + return VA_STATUS_ERROR_INVALID_SURFACE; + } if (surf->buffer) surf->buffer->destroy(surf->buffer); util_dynarray_fini(&surf->subpics); |