[Libva] [PATCH 1/3] extbuf: fix possible buffer overflow.

Gwenole Beauchesne gb.devel at gmail.com
Thu Apr 2 06:28:18 PDT 2015


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

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne 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 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



More information about the Libva mailing list