diff options
author | Luca Barbieri <[email protected]> | 2010-08-11 22:26:57 +0200 |
---|---|---|
committer | Luca Barbieri <[email protected]> | 2010-08-11 22:32:20 +0200 |
commit | 39cd4f7ceb09dc3050f93d1fb326faf24c11150e (patch) | |
tree | 2a2e5c4597717d03360019ad65e78b878a402d08 /src | |
parent | 41c7ff11e6aa4d82d1175446aea0984bf28e3905 (diff) |
translate_test: fix segfault on x86-64
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/tests/unit/translate_test.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gallium/tests/unit/translate_test.c b/src/gallium/tests/unit/translate_test.c index a934a6abf46..097a5fd9371 100644 --- a/src/gallium/tests/unit/translate_test.c +++ b/src/gallium/tests/unit/translate_test.c @@ -128,7 +128,7 @@ int main(int argc, char** argv) for (output_format = 1; output_format < PIPE_FORMAT_COUNT; ++output_format) { const struct util_format_description* output_format_desc = util_format_description(output_format); - unsigned output_format_size = util_format_get_stride(output_format, 1); + unsigned output_format_size; if (!output_format_desc || !output_format_desc->fetch_rgba_float || !output_format_desc->pack_rgba_float @@ -137,10 +137,12 @@ int main(int argc, char** argv) || !translate_is_output_format_supported(output_format)) continue; + output_format_size = util_format_get_stride(output_format, 1); + for (input_format = 1; input_format < PIPE_FORMAT_COUNT; ++input_format) { const struct util_format_description* input_format_desc = util_format_description(input_format); - unsigned input_format_size = util_format_get_stride(input_format, 1); + unsigned input_format_size; struct translate* translate[2]; unsigned fail = 0; unsigned used_generic = 0; @@ -153,6 +155,8 @@ int main(int argc, char** argv) || !translate_is_output_format_supported(input_format)) continue; + input_format_size = util_format_get_stride(input_format, 1); + key.element[0].input_format = input_format; key.element[0].output_format = output_format; key.output_stride = output_format_size; |