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 - Crash on SDL_Quit(), at SDL_audiocvt.c:1001, because stream->reset_Resampler_func function pointer is NULL (rev 016a40fda1bb)
Summary: Crash on SDL_Quit(), at SDL_audiocvt.c:1001, because stream->reset_Resampler_...
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: audio (show other bugs)
Version: HG 2.1
Hardware: All All
: P2 critical
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-06 13:22 UTC by Vitaly Novichkov
Modified: 2017-01-07 03:33 UTC (History)
1 user (show)

See Also:


Attachments
Debugger state (99.01 KB, image/png)
2017-01-06 13:22 UTC, Vitaly Novichkov
Details

Note You need to log in before you can comment on or make changes to this bug.
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.