According to http://www.opengl.org/wiki/GLAPI/glVertexAttribPointer :
GL_INVALID_OPERATION is generated if size is GL_BGRA and type is not GL_UNSIGNED_BYTE, GL_INT_2_10_10_10_REV or GL_UNSIGNED_INT_2_10_10_10_REV.
GL_INVALID_OPERATION is generated if type is GL_INT_2_10_10_10_REV or GL_UNSIGNED_INT_2_10_10_10_REV and size is not 4 or GL_BGRA.
GL_INVALID_OPERATION is generated if type is GL_UNSIGNED_INT_10F_11F_11F_REV and size is not 3.
GL_INVALID_OPERATION is generated by glVertexAttribPointer if size is GL_BGRA and noramlized is GL_FALSE.
GL_INVALID_OPERATION is generated if zero is bound to the GL_ARRAY_BUFFER buffer object binding point and the pointer argument is not NULL.
GL_INVALID_OPERATION is generated if no vertex array object is bound.
The first 4 are obviously not the case so it must be one of the last 2. The last one can't be the case as it doesn't always throw the error, and the last one would. So the problem according to the wiki is:
GL_INVALID_OPERATION is generated if zero is bound to the GL_ARRAY_BUFFER buffer object binding point and the pointer argument is not NULL.
This would mean vertexBufferObject
in your code is 0 and thus not a valid buffer object. If this is not the case, I'd think you just stumbled upon a major driver bug.