glDrawElements crashes my program

Hi there
I use from the cal3D API to load the 3D models with their keyframes. this API finds the vertex data, normal data , texture coordinate data and face indices. But when i want to draw the faces with the following code, it produces a run-time error:
if( sizeof( CalIndex ) == 2 )
{
glDrawElements( GL_TRIANGLES, faceCount * 3, GL_UNSIGNED_SHORT, &meshFaces[0][0] );
}
else
{
glDrawElements( GL_TRIANGLES, faceCount * 3, GL_UNSIGNED_INT, &meshFaces[0][0] );
}

Why does glDrawElements crash my program?
-Ehsan-

Hi !

I guess there are two things that could do it, you have some kind of bug in your OpenGL driver but then other applications should crash also, the other alternative is that you pass incorrect data to the function, the code in the message only shows the actual call so it is difficult to answer more detailed on that.

Mikael

Hi
I solved that problem. Now the human is walking in the scene:)
-Ehsan-