According to the OpenGL documentation, glGetTextureSubImage accepts the following pixel formats: GL_RED, GL_RG, GL_RGB, GL_BGR, GL_RGBA, GL_BGRA, GL_DEPTH_COMPONENT, GL_STENCIL_INDEX. In reality it requires you to specify GL_RED_INTEGER, GL_RG_INTEGER, GL_RGB_INTEGER, GL_BGR_INTEGER, GL_RGBA_INTEGER, GL_BGRA_INTEGER if you're using an integer (not char/byte) texture.
This may or may not be a bug in mesa.