GLfloat aspect = event.xconfigure.width/event.xconfigure.height
/* 0 by integer division */
GLubyte buf[] = {0x9D, ... 0xA7};
/* a lot of bitmap images are passed as bytes! */
glBitmap(w, h, x, y, 0, 0, buf);
The default GL_UNPACK_ALIGNMENT is 4. It should be 1 in the case above.
The same thing applies to textures.