As the error message indicates - glGetInteger requires a buffer with 16 remaining slots. This is the maximum number of values which OpenGL's glGetInteger can return.
Although 16 values probably is the maximum number glGetInteger can return, with pname 'GL_VIEWPORT' it is 4.
http://www.opengl.org/sdk/docs/man/xhtml/glGet.xml:
GL_VIEWPORT params returns four values:
the x and y window coordinates of the viewport, followed by its width and height. Initially the x and y window coordinates are both set to 0, and the width and height are set to the width and height of the window into which the GL will do its rendering. See glViewport.