diff options
author | Sergii Romantsov <sergii.romantsov@globallogic.com> | 2018-11-21 12:17:42 +0200 |
---|---|---|
committer | Marek Olšák <marek.olsak@amd.com> | 2019-06-03 15:44:53 -0400 |
commit | 440a42facc48dd7c9f1c7b4f495686e689177180 (patch) | |
tree | d8a6c74d80eb8d54d2443b86edeb1c588de550d9 /tests | |
parent | 585d56b79f8a2ac639bacf4db6811cf1f1b89797 (diff) |
test: fix core dump for depthstencil-render-miplevels
Usage test 'depthstencil-render-miplevels 200 s=z24_s8' causes
core dump on exit.
Fixed: array of pointers is allocated to size max_miplevel, but
used as max_miplevel + 1.
CC: Eric Anholt <eric@anholt.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108819
Issue: https://gitlab.freedesktop.org/mesa/piglit/issues/9
Fixes: 7a0e61d7792f (depthstencil-render-miplevels: Present the results in non-auto mode.)
Signed-off-by: Sergii Romantsov <sergii.romantsov@globallogic.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/texturing/depthstencil-render-miplevels.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/texturing/depthstencil-render-miplevels.cpp b/tests/texturing/depthstencil-render-miplevels.cpp index 87af92fec..9d4b42d55 100644 --- a/tests/texturing/depthstencil-render-miplevels.cpp +++ b/tests/texturing/depthstencil-render-miplevels.cpp @@ -360,8 +360,8 @@ piglit_init(int argc, char **argv) piglit_require_extension("GL_ARB_depth_texture"); piglit_require_extension("GL_ARB_texture_non_power_of_two"); - depth_miplevel_data = (float **)calloc(max_miplevel, sizeof(float *)); - stencil_miplevel_data = (uint8_t **)calloc(max_miplevel, + depth_miplevel_data = (float **)calloc(max_miplevel + 1, sizeof(float *)); + stencil_miplevel_data = (uint8_t **)calloc(max_miplevel + 1, sizeof(uint8_t *)); /* argv[2]: buffer combination */ |