[Libva] [PATCH libva-intel-driver] Fix bound checking
Zhao Yakui
yakui.zhao at intel.com
Tue Apr 15 22:35:29 PDT 2014
On Mon, 2014-04-14 at 20:20 -0600, Xiang, Haihao wrote:
> From: "Xiang, Haihao" <haihao.xiang at intel.com>
>
> Otherwise it might result in buffer overflow.
LGTM.
Pushed.
Thanks.
>
> Signed-off-by: Xiang, Haihao <haihao.xiang at intel.com>
> ---
> src/i965_drv_video.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/i965_drv_video.c b/src/i965_drv_video.c
> index cc61ad3..9fa85af 100755
> --- a/src/i965_drv_video.c
> +++ b/src/i965_drv_video.c
> @@ -2326,7 +2326,7 @@ i965_encoder_render_misc_parameter_buffer(VADriverContextP ctx,
>
> param = (VAEncMiscParameterBuffer *)obj_buffer->buffer_store->buffer;
>
> - if (param->type > ARRAY_ELEMS(encode->misc_param))
> + if (param->type >= ARRAY_ELEMS(encode->misc_param))
> return VA_STATUS_ERROR_INVALID_PARAMETER;
>
> i965_release_buffer_store(&encode->misc_param[param->type]);
More information about the Libva
mailing list