stuhood/gvi — Issue #1: Error when int[] has group+2 elements
Author: nobre84
Created: 2011-11-08 14:38:10+00:00
State: open

Hi, first, thank you for the effort on posting the project up!
I found an issue when the encoded array has group + 2 elements (6, 10, 14, etc)

I fixed by changing:

switch (length - idx)
{
case 3: encodeGroup(buff, values[idx], values[idx++], values[idx++], 0);
case 2: encodeGroup(buff, values[idx], values[idx++], 0, 0);
case 1: encodeGroup(buff, values[idx], 0, 0, 0);
}

to

switch (length - idx)
{
case 3: encodeGroup(buff, values[idx++], values[idx++], values[idx++], 0);
case 2: encodeGroup(buff, values[idx++], values[idx++], 0, 0);
case 1: encodeGroup(buff, values[idx++], 0, 0, 0);
}