summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi/radeonsi_shader.c
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2013-05-14 19:37:17 +0200
committerMichel Dänzer <michel@daenzer.net>2013-05-21 17:47:44 +0200
commit2eac0aa1d8d6fbdbbee43e44b24cff7f71733764 (patch)
tree18c988bb9b8b34f3ddba2639686b4bacba078c21 /src/gallium/drivers/radeonsi/radeonsi_shader.c
parent9772284df2cba1dd30ec401fd19c5a212197b411 (diff)
downloadexternal_mesa3d-2eac0aa1d8d6fbdbbee43e44b24cff7f71733764.zip
external_mesa3d-2eac0aa1d8d6fbdbbee43e44b24cff7f71733764.tar.gz
external_mesa3d-2eac0aa1d8d6fbdbbee43e44b24cff7f71733764.tar.bz2
radeonsi: increase array size for shader inputs and outputs
and add assertions to prevent buffer overflow. This fixes corruption of the si_shader struct. NOTE: This is a candidate for the 9.1 branch. [ Cherry-pick of r600g commit da33f9b919039442e9ab51f9b1d1c83a73607133 ] Reviewed-by: Marek Olšák <maraeo@gmail.com>
Diffstat (limited to 'src/gallium/drivers/radeonsi/radeonsi_shader.c')
-rw-r--r--src/gallium/drivers/radeonsi/radeonsi_shader.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeonsi/radeonsi_shader.c b/src/gallium/drivers/radeonsi/radeonsi_shader.c
index f942436..bea2895 100644
--- a/src/gallium/drivers/radeonsi/radeonsi_shader.c
+++ b/src/gallium/drivers/radeonsi/radeonsi_shader.c
@@ -589,6 +589,7 @@ static void si_llvm_emit_epilogue(struct lp_build_tgsi_context * bld_base)
switch (d->Declaration.File) {
case TGSI_FILE_INPUT:
i = shader->ninput++;
+ assert(i < Elements(shader->input));
shader->input[i].name = d->Semantic.Name;
shader->input[i].sid = d->Semantic.Index;
shader->input[i].interpolate = d->Interp.Interpolate;
@@ -597,6 +598,7 @@ static void si_llvm_emit_epilogue(struct lp_build_tgsi_context * bld_base)
case TGSI_FILE_OUTPUT:
i = shader->noutput++;
+ assert(i < Elements(shader->output));
shader->output[i].name = d->Semantic.Name;
shader->output[i].sid = d->Semantic.Index;
shader->output[i].interpolate = d->Interp.Interpolate;