diff options
author | Xiang, Haihao <haihao.xiang@intel.com> | 2014-04-14 20:20:31 -0600 |
---|---|---|
committer | Xiang, Haihao <haihao.xiang@intel.com> | 2014-04-23 14:22:12 +0800 |
commit | 2d00edc3d07997bd322ce4d905c84cb7f52dd421 (patch) | |
tree | 44355950d060c1f9fa1e7b1e36844a40dbbf68a1 | |
parent | 3867b81bf99924f9887cc6ccecf9287256f1d7e6 (diff) | |
download | libva-intel-driver-2d00edc3d07997bd322ce4d905c84cb7f52dd421.tar.gz libva-intel-driver-2d00edc3d07997bd322ce4d905c84cb7f52dd421.tar.bz2 libva-intel-driver-2d00edc3d07997bd322ce4d905c84cb7f52dd421.zip |
Fix bound checking
Otherwise it might result in buffer overflow.
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
(cherry picked from commit 782b8afdda14f000874d8acf51c3e8c490d55773)
-rwxr-xr-x | src/i965_drv_video.c | 2 |
1 files changed, 1 insertions, 1 deletions
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]); |