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 1085 - Jump to NULL function pointer on ALSA_OpenDevice when not SDL_AUDIO_DRIVER_ALSA_DYNAMIC
Summary: Jump to NULL function pointer on ALSA_OpenDevice when not SDL_AUDIO_DRIVER_AL...
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: audio (show other bugs)
Version: HG 2.0
Hardware: All Linux
: P2 major
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-16 02:41 UTC by Bruno
Modified: 2011-02-16 04:09 UTC (History)
0 users

See Also:


Attachments
Fix segfault in ALSA_OpenDevice() (936 bytes, text/plain)
2010-12-16 02:41 UTC, Bruno
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bruno 2010-12-16 02:41:51 UTC
Created attachment 550 [details]
Fix segfault in ALSA_OpenDevice()

When alsa is linked to libsdl instead of being loaded on demand at runtime the alsa macro snd_pcm_hw_params_alloca(ptr); misbehaves.

That macro calls snd_pcm_hw_params_sizeof() in order to determine the amount of memory to allocate but due to mis-placed define that function is replaced with ALSA_snd_pcm_hw_params_sizeof by preprocessor (and in case of link to alsa that function pointer is initialized to itself).

Attached patch fixes the issue.
Comment 1 Sam Lantinga 2011-02-16 04:09:02 UTC
This patch is in, thanks!
http://hg.libsdl.org/SDL/rev/192f2d605339