nvfx: don't crash on empty fragment program
authorLuca Barbieri <luca@luca-barbieri.com>
Sun, 17 Jan 2010 21:27:53 +0000 (22:27 +0100)
committerLuca Barbieri <luca@luca-barbieri.com>
Tue, 23 Mar 2010 14:41:10 +0000 (15:41 +0100)
src/gallium/drivers/nvfx/nvfx_fragprog.c

index 76351430f44e46838cb7becfb8952a4daf63b457..b9c91cec8ce986e6ba29c2676b0db1ba3cd5a285 100644 (file)
@@ -803,7 +803,8 @@ nvfx_fragprog_translate(struct nvfx_context *nvfx,
                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;