[AD] Potential memory corruption under Windows

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


I just came across the following potential problem under Windows this
morning: if a joystick has the full set of controls supported by the Win32
joystick interface, then the memory gets corrupted. The Win32 joystick
interface internally supports 6 axes (X,Y,Z,R,U,V) and one hat (POV device);
it is mapped to the Allegro joystick interface in the following way:
- X,Y,Z axes --> 1st stick, 3 axes
- R axe --> 2nd stick, 1 axis
- U axe --> 3rd stick, 1 axis
- V axe --> 4th stick, 1 axis
- POV --> 5th stick, 2 axes

Now from include/allegro/joystick.h:
#define MAX_JOYSTICK_STICKS      4


The patch (joy.diff) is attached. If someone is willing to commit it, then
do the same for joy_win32.diff that only fixes the name of the axes and the
spelling of the singular of 'axes' in the Win32 specific code.

--
Eric Botcazou
ebotcazou@xxxxxxxxxx

Attachment: joy.zip
Description: Zip compressed data



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/