check if button >= GLUT_MAX_MENUS in glutAttacheMenu()

This commit is contained in:
Brian Paul 2006-05-10 19:21:16 +00:00
parent adc0490420
commit 700359ca5a

View file

@ -1000,6 +1000,10 @@ glutAddSubMenu(const char *label, int menu)
void GLUTAPIENTRY
glutAttachMenu(int button)
{
/* if button >= GLUT_MAX_MENUS, we'll go out of array bounds below */
if (button >= GLUT_MAX_MENUS) {
return;
}
if (__glutMappedMenu) {
__glutMenuModificationError();
}