We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4514

Summary: SDL_audiocvt crashes on enumerating hardware during HID?
Product: SDL Reporter: superfury
Component: audioAssignee: Ryan C. Gordon <icculus>
Status: NEW --- QA Contact: Sam Lantinga <slouken>
Severity: major    
Priority: P2    
Version: 2.0.9   
Hardware: x86_64   
OS: Windows 10   

Description superfury 2019-02-20 12:32:56 UTC
When I run my app using SDL 2.0.9 while switching between Windows 10 using RDP and without RDP(which happens a lot during me developing my app), either after some time or because I'm mounting the mouse/keyboard by hiding the mouse the normal way(changed with SDL 2.0+. Haven't figured out the exact cause yet), I see the hid_enumerate function crashing in it's enumeration loop, trying to dereference an invalid pointer?

These are the lines of code that remain in Visual Studio after the debugger had stopped the application:

src/hidapi/windows/hid.c:419
src/events/SDL_events.c:664
src/audio/SDL_audiocvt.c:558
src/joystick/SDL_joystick.c:1075
src/joystick/hidapi/SDL_hidapijoystick.c:872

I think the first error came from the VC++ debugger on the hic.c line, but it might also have been the SDL_audiocvt.c line.

Either way, for some unknown reason, SDL crashed dereferencing a NULL pointer at either device enumeration(hid.c) or audio convertion(SDL_audiocvt.c)?
Comment 1 superfury 2019-02-20 12:51:15 UTC
If I remember correctly, the debugger was breaking at the SDL_audiocvt.c line, so perhaps the HID API had nothing directly to do with it.