plugins: fix out of bounds read in chopper
GCC complains about this when compiling with UBSan. Change-Id: I4bd8ff2b47882ab95620dc7750a9a80f823cc2ea
This commit is contained in:
parent
ab71b9e334
commit
366f00a3d3
1 changed files with 12 additions and 13 deletions
|
@ -523,19 +523,18 @@ static void chopAddBlock(int x,int y,int sx,int sy, int indexOverride)
|
||||||
|
|
||||||
static void chopAddParticle(int x,int y,int sx,int sy)
|
static void chopAddParticle(int x,int y,int sx,int sy)
|
||||||
{
|
{
|
||||||
int i=0;
|
for(int i = 0; i < NUMBER_OF_PARTICLES; ++i)
|
||||||
|
{
|
||||||
while(mParticles[i].bIsActive && i < NUMBER_OF_PARTICLES)
|
if(!mParticles[i].bIsActive)
|
||||||
i++;
|
{
|
||||||
|
mParticles[i].bIsActive = 1;
|
||||||
if(i==NUMBER_OF_PARTICLES)
|
mParticles[i].iWorldX = x;
|
||||||
return;
|
mParticles[i].iWorldY = y;
|
||||||
|
mParticles[i].iSpeedX = sx;
|
||||||
mParticles[i].bIsActive = 1;
|
mParticles[i].iSpeedY = sy;
|
||||||
mParticles[i].iWorldX = x;
|
return;
|
||||||
mParticles[i].iWorldY = y;
|
}
|
||||||
mParticles[i].iSpeedX = sx;
|
}
|
||||||
mParticles[i].iSpeedY = sy;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void chopGenerateBlockIfNeeded(void)
|
static void chopGenerateBlockIfNeeded(void)
|
||||||
|
|
Loading…
Reference in a new issue