https://bugs.winehq.org/show_bug.cgi?id=46999
Bug ID: 46999 Summary: Controller with invalid HID range value causes division by zero error Product: Wine Version: 4.5 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: xinput Assignee: wine-bugs@winehq.org Reporter: gerbilsoft@gerbilsoft.com Distribution: ---
I have an 8bitdo M30 controller, which is similar in design to a Sega Mega Drive 6-button gamepad. Attempting to play the game Sonic 3 AIR with the controller connected resulted in a division by zero error. I finally narrowed it down to a crash in xinput1_3/hid.c, scale_short().
It seems that, since the controller doesn't have analog sticks, it reports a range of 0. scale_short() doesn't expect this, so it ends up dividing by zero.
Workaround: If range is 0, return 0.
https://bugs.winehq.org/show_bug.cgi?id=46999
--- Comment #1 from David Korth gerbilsoft@gerbilsoft.com --- Note that the M30 has options to remap the D-Pad to Left Stick or Right Stick (default is D-Pad, aka "hat"). I'm not sure how that affects the HID ranges. If anyone can point me to a tool that can show the HID usage descriptors, I'll post them here.
https://bugs.winehq.org/show_bug.cgi?id=46999
pattietreutel katyaberezyaka@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |katyaberezyaka@gmail.com
https://bugs.winehq.org/show_bug.cgi?id=46999
Alistair Leslie-Hughes leslie_alistair@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |leslie_alistair@hotmail.com Fixed by SHA1| |72e62952db9104b03d136d9fa0e | |bdb1e8aa6ae52 Resolution|--- |FIXED Status|UNCONFIRMED |RESOLVED
--- Comment #2 from Alistair Leslie-Hughes leslie_alistair@hotmail.com --- Fixed by https://source.winehq.org/git/wine.git/?a=commit;h=72e62952db9104b03d136d9fa...
https://bugs.winehq.org/show_bug.cgi?id=46999
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #3 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 4.7.