glx: fix incorrect array stack memory allocation