$ 0 0 GL_MAX_ARRAY_TEXTURE_LAYERS = 35071 is not the max value, it's a enum constant. Pass it to glGetIntegerv.