From d7053422f14d60daca97a3c3c321ae82fd82025a Mon Sep 17 00:00:00 2001 From: Simon Robertshaw Date: Tue, 12 Jul 2011 06:54:47 -0700 Subject: [PATCH] fix potential crashes with LIFE - jacksonmj --- src/powder.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/powder.c b/src/powder.c index 2a72fee64..853914d62 100644 --- a/src/powder.c +++ b/src/powder.c @@ -831,7 +831,7 @@ inline int create_part(int p, int x, int y, int tv)//the function for creating a if (t==goltype[r]) parts[i].tmp = grule[r+1][9] - 1; }*/ - if (t==PT_LIFE) + if (t==PT_LIFE && v>8].type==PT_LIFE/* && parts[r>>8].ctype==golnum-1*/) { golnum = parts[r>>8].ctype+1; + if (golnum<=0 || golnum>NGOLALT) { + parts[r>>8].type = PT_NONE; + continue; + } if (parts[r>>8].tmp == grule[golnum][9]-1) { gol[nx][ny] = golnum; for ( nnx=-1; nnx<2; nnx++)