From 2d00edc3d07997bd322ce4d905c84cb7f52dd421 Mon Sep 17 00:00:00 2001 From: "Xiang, Haihao" Date: Mon, 14 Apr 2014 20:20:31 -0600 Subject: Fix bound checking Otherwise it might result in buffer overflow. Reviewed-by: Zhao Yakui Signed-off-by: Xiang, Haihao (cherry picked from commit 782b8afdda14f000874d8acf51c3e8c490d55773) --- 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 e801a4d..60174b2 100755 --- a/src/i965_drv_video.c +++ b/src/i965_drv_video.c @@ -2281,7 +2281,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]); -- cgit v1.2.3