[Bug 46999] New: Controller with invalid HID range value causes division by zero error

wine-bugs at winehq.org wine-bugs at winehq.org
Fri Apr 12 22:29:35 CDT 2019


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 at winehq.org
          Reporter: gerbilsoft at 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.

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list