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 3547

Summary: Crash on SDL_Quit(), at SDL_audiocvt.c:1001, because stream->reset_Resampler_func function pointer is NULL (rev 016a40fda1bb)
Product: SDL Reporter: Vitaly Novichkov <admin>
Component: audioAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: critical    
Priority: P2 CC: admin
Version: HG 2.1   
Hardware: All   
OS: All   
Attachments: Debugger state

Description Vitaly Novichkov 2017-01-06 13:22:49 UTC
Created attachment 2661 [details]
Debugger state

Today I tried to review and test new updates (and update my patch for resampler's chunk length calculation). But on an attempt to close library by SDL_Quit() I got a crash on attempt to call stream->reset_Resampler_func() function pointer which is NULL!

I see you have added ability to use libresample instead built-in resampler, but I built with internal resampler without adding extra dependencies. Seems you forgot to check that function for zero (in case if reset is not needed) or you forgot to set it in necessary moment, or you zeroed it BEFORE calling this.
Comment 1 Ryan C. Gordon 2017-01-07 02:24:37 UTC
I've added a NULL check in https://hg.libsdl.org/SDL/rev/7e935b2c430f to stop the crash, but I need to track down how we ended up in that state, so I'll leave this bug open and assigned to me for now.

--ryan.
Comment 2 Sam Lantinga 2017-01-07 03:33:25 UTC
Oh, this is easy. src_rate == dst_rate, so no resampling was set up. :)
A NULL check is the right thing to do here.