Fix possible buffer overflow when addressing the array of buffer handles
to be imported into VA surfaces.

Signed-off-by: Gwenole Beauchesne <gwenole.beauche...@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 e2abc1b..0b04bd5 100644
--- a/src/i965_drv_video.c
+++ b/src/i965_drv_video.c
@@ -1004,7 +1004,7 @@ i965_suface_external_memory(VADriverContextP ctx,
 
     if (!memory_attibute ||
         !memory_attibute->buffers ||
-        index > memory_attibute->num_buffers)
+        index >= memory_attibute->num_buffers)
         return VA_STATUS_ERROR_INVALID_PARAMETER;
 
     ASSERT_RET(obj_surface->orig_width == memory_attibute->width, 
VA_STATUS_ERROR_INVALID_PARAMETER);
-- 
1.9.1

_______________________________________________
Libva mailing list
Libva@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libva

Reply via email to