freedreno/ir3: fix potential null ptr deref
authorRob Clark <robclark@freedesktop.org>
Sat, 30 Aug 2014 20:51:46 +0000 (16:51 -0400)
committerRob Clark <robclark@freedesktop.org>
Sat, 30 Aug 2014 22:02:51 +0000 (18:02 -0400)
Fix potential segfault in debug code.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
src/gallium/drivers/freedreno/ir3/ir3_dump.c

index 1a6f49d51cd7f2c315277e82986c9d55c4227b20..61336284412c86becd7fbbe37dd01ae69fb73b06 100644 (file)
@@ -322,7 +322,8 @@ static void ir3_block_dump(struct ir3_dump_ctx *ctx,
 
        /* draw instruction graph: */
        for (i = 0; i < block->noutputs; i++)
-               dump_instr(ctx, block->outputs[i]);
+               if (block->outputs[i])
+                       dump_instr(ctx, block->outputs[i]);
 
        /* draw outputs: */
        fprintf(ctx->f, "output%lx [shape=record,label=\"outputs", PTRID(block));