[Nouveau] [PATCH 1/2] nv40: don't crash on empty fragment program

Luca Barbieri luca at luca-barbieri.com
Sun Jan 17 13:35:59 PST 2010


---
 src/gallium/drivers/nv40/nv40_fragprog.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/nv40/nv40_fragprog.c b/src/gallium/drivers/nv40/nv40_fragprog.c
index 1237066..209d211 100644
--- a/src/gallium/drivers/nv40/nv40_fragprog.c
+++ b/src/gallium/drivers/nv40/nv40_fragprog.c
@@ -843,7 +843,8 @@ nv40_fragprog_translate(struct nv40_context *nv40,
 	fp->fp_control |= fpc->num_regs << NV40TCL_FP_CONTROL_TEMP_COUNT_SHIFT;
 
 	/* Terminate final instruction */
-	fp->insn[fpc->inst_offset] |= 0x00000001;
+	if(fp->insn)
+                fp->insn[fpc->inst_offset] |= 0x00000001;
 
 	/* Append NOP + END instruction, may or may not be necessary. */
 	fpc->inst_offset = fp->insn_len;
-- 
1.6.3.3



More information about the Nouveau mailing list