diff options
author | Lim Siew Hoon <siew.hoon.lim@intel.com> | 2016-07-01 11:13:23 +0800 |
---|---|---|
committer | Xiang, Haihao <haihao.xiang@intel.com> | 2016-08-22 13:04:29 +0800 |
commit | d37c042e20d1e91f86042b8ca47dd70eac3e2b8c (patch) | |
tree | 419d4c24dcc35f96597d86ce2c50a7a762141cb5 | |
parent | b6ee5d57d62999bfb4a098145f3dd8ebcff954c2 (diff) |
Fix buffer overflow for array index out of bounds in test_07
The size of array surface_1 is 2, but it passed to test_unique_surfaces
func is 16 or 6 to do compare for surface_16. The index for surface_1
not in the array index range for surface_1 and access invalid memory
location.
Signed-off-by: Lim Siew Hoon <siew.hoon.lim@intel.com>
(cherry picked from commit e4535e404d1dc33fb1fddf99f057c341fc652bfd)
-rw-r--r-- | test/basic/test_07.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/basic/test_07.c b/test/basic/test_07.c index 2e01533..752b0bf 100644 --- a/test/basic/test_07.c +++ b/test/basic/test_07.c @@ -84,7 +84,7 @@ void test() test_unique_surfaces(surfaces_4, 4, surfaces_16, 4); test_unique_surfaces(surfaces_4, 4, surfaces_16, 16); test_unique_surfaces(surfaces_4, 1, surfaces_16, 16); - test_unique_surfaces(surfaces_1, 16, surfaces_16, 16); + test_unique_surfaces(surfaces_1, 1, surfaces_16, 16); status("vaDestroySurface 4 surfaces\n"); va_status = vaDestroySurfaces(va_dpy, surfaces_4, 4); @@ -98,7 +98,7 @@ void test() test_unique_surfaces(surfaces_1, 1, surfaces_6, 6); test_unique_surfaces(surfaces_6, 6, surfaces_16, 16); - test_unique_surfaces(surfaces_1, 6, surfaces_16, 6); + test_unique_surfaces(surfaces_1, 1, surfaces_16, 6); status("vaDestroySurface 16 surfaces\n"); va_status = vaDestroySurfaces(va_dpy, surfaces_16, 16); |