wrong leds lit in matrix display - wrong coding?
Initialize your arrays like this:

int a[3][4] = {  
   {0, 1, 2, 3} ,   /*  initializers for row indexed by 0 */
   {4, 5, 6, 7} ,   /*  initializers for row indexed by 1 */
   {8, 9, 10, 11}   /*  initializers for row indexed by 2 */
};


...you can read more about it here.

Added later...

The following explanation came from here:

Arrays that are not explicitly divided into rows:

int M[4][5] = {10, 5, -3, 9, 0, 0, 32, 20, 1, 0, 0, 8};


...are filled like this:

int M[4][5] =
{
  {10,  5, -3, 9, 0},
  { 0, 32, 20, 1, 0},
  { 0,  8,  0, 0, 0},
  { 0,  0,  0, 0, 0}
};


As only you understand your data you will have to verify if your data is populating the array as you expect.