aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorBartosz Tomczyk <[email protected]>2017-01-30 14:07:45 +0100
committerEmil Velikov <[email protected]>2017-02-03 11:08:58 +0000
commit301c9b96f23b43bef25a6d8a6040f19ccb74891a (patch)
treefdeed905e7773f7537b3c9823bd09dff3d724a2b /src/gallium/drivers
parent06b9bc66d58dd6b2adf16142ca05875c953fcc5f (diff)
r600: Fix stack overflow
Commit 7b5878ee0491e7a93914389a8369cd6752b9757d increased number of outputs to 64, but left output array intact. This caused stack overflow when number of outputs is bigger then 32. Found by ASAN. Cc: "12.0 13.0 17.0" <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> (cherry picked from commit a41f2527ae8ae5432b99c88863fbdf2f0b5f04ad)
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/r600/r600_shader.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c
index eaabb042f97..070246c57be 100644
--- a/src/gallium/drivers/r600/r600_shader.c
+++ b/src/gallium/drivers/r600/r600_shader.c
@@ -2924,7 +2924,7 @@ static int r600_shader_from_tgsi(struct r600_context *rctx,
struct pipe_stream_output_info so = pipeshader->selector->so;
struct tgsi_full_immediate *immediate;
struct r600_shader_ctx ctx;
- struct r600_bytecode_output output[32];
+ struct r600_bytecode_output output[ARRAY_SIZE(shader->output)];
unsigned output_done, noutput;
unsigned opcode;
int i, j, k, r = 0;