I have a function
void GenerateBlockBuffer(Vertex* vertices, int* indices, int vertexCount, int indexCount)
vb.vertexCount = vertexCount;
ib.indexCount = indexCount;
glBufferData(GL_ARRAY_BUFFER, vb.vertexCount * 7 * sizeof(GLfloat), vertices, GL_STATIC_DRAW);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, ib.indexCount * sizeof(GLint), indices, GL_STATIC_DRAW);
and it crashes on
with: 0xC0000005: Access violation reading location 0x00000019, when ib.id = 164.
The VertexBuffer and IndexBuffer structs each have an int that stores the buffer id and an int that stores how many vertices or indices are in the buffer. I do not understand what causes it to crash.
EDIT: It compiles and runs fine in release but not debug.