Mesa (master): r600g: fix segfault if texture operand is a literal

Christian König deathsimple at kemper.freedesktop.org
Wed Jan 19 22:57:54 UTC 2011


Module: Mesa
Branch: master
Commit: a124490262a29d2e873fe50ca57974f246946b85
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a124490262a29d2e873fe50ca57974f246946b85

Author: Christian König <deathsimple at vodafone.de>
Date:   Wed Jan 19 23:46:27 2011 +0100

r600g: fix segfault if texture operand is a literal

This fixes Bug 33262

---

 src/gallium/drivers/r600/r600_shader.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c
index 5c5ff4e..df97c32 100644
--- a/src/gallium/drivers/r600/r600_shader.c
+++ b/src/gallium/drivers/r600/r600_shader.c
@@ -1838,7 +1838,9 @@ static int tgsi_tex(struct r600_shader_ctx *ctx)
 		for (i = 0; i < 4; i++) {
 			memset(&alu, 0, sizeof(struct r600_bc_alu));
 			alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MOV);
-			alu.src[0].sel = src_gpr;
+			r = tgsi_src(ctx, &inst->Src[0], &alu.src[0]);
+			if (r)
+				return r;
 			alu.src[0].chan = tgsi_chan(&inst->Src[0], i);
 			alu.dst.sel = ctx->temp_reg;
 			alu.dst.chan = i;




More information about the mesa-commit mailing list