[Libva] [PATCH_v2] Fix the issue in i965_UnlockSurface to lock it next time

Xiang, Haihao haihao.xiang at intel.com
Tue Oct 23 22:09:16 PDT 2012


On Fri, 2012-10-19 at 13:02 -0400, yakui.zhao at intel.com wrote: 
> From: Zhao Yakui <yakui.zhao at intel.com>
> 
> It uses the variable of locked_image_id to check whether one surface is locked
> or not. But as the locked_image_id is not assigned correctly, it causes that
> it can't lock one surface next time although it calls the vaUnlockSurfaces.
> Then the libva trace log can't dump the content of decoded/
> encoded surface correctly even after adding LIBVA_TRACE_SURFACE=XXX.
> 
> Signed-off-by: Zhao Yakui <yakui.zhao at intel.com>
> Reviewed-by: Gwenole Beauchesne <gb.devel at gmail.com>
> ---
>  src/i965_drv_video.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/src/i965_drv_video.c b/src/i965_drv_video.c
> index 8a99e43..8e5bbf6 100755
> --- a/src/i965_drv_video.c
> +++ b/src/i965_drv_video.c
> @@ -3646,6 +3646,8 @@ i965_UnlockSurface(
>      locked_img->image.image_id = VA_INVALID_ID;
>  
>   error:
> +    obj_surface->locked_image_id = VA_INVALID_ID;

It will cause segment fault if obj_surface is NULL in the error path

> +
>      return vaStatus;
>  }
>  




More information about the Libva mailing list