Added missing check for size of IndexBuffer

same problem as in vertex buffer :-)