1. A computer-implemented method of validating an attempt to draw an image using a graphics library including functions and elements, the method comprising: receiving a request from a user to use a first function to draw the image, the request identifying an index buffer including a set of index values each index value of the set of index values being a pointer to an element in an array; identifying a set of code to draw the image, a set of code being associated with a set of inputs; identifying one or more buffers created for each of the arrays of the index values of the set of index values; identifying a given buffer of the one or more buffers based on the set of inputs; identifying, by one or more processors, a size of the given buffer; scanning, by the one or more processors, the index buffer to identify a highest index value; and comparing, by the one or more processors, the size of the given buffer to the highest index value to determine whether to validate the request.