[Mesa-dev] [PATCH] st/va: Check NULL pointer
Julien Isorce
julien.isorce at gmail.com
Sun Jun 26 08:00:29 UTC 2016
Thx for the patch:
Reviewed-by: Julien Isorce <j.isorce at samsung.com>
I'll push it today.
On 26 June 2016 at 08:02, Gurkirpal Singh <gurkirpal204 at gmail.com> wrote:
> Call to handle_table_get in vlVaDestroySurfaces can
> return NULL on failure.
>
> CID: 1243522
>
> Signed-off-by: Gurkirpal Singh <gurkirpal204 at gmail.com>
> ---
> src/gallium/state_trackers/va/surface.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/src/gallium/state_trackers/va/surface.c
> b/src/gallium/state_trackers/va/surface.c
> index 5efb893..3e74353 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);
> --
> 2.7.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160626/2fbf1119/attachment-0001.html>
More information about the mesa-dev
mailing list