libvlc audio callbacks crash
Posted: 30 Jun 2013 13:56
I have been using the audio callbacks and encountered a crash. It is repeatable 100% of the time for me.
In amem.c:
In the failing case, sys->cleanup is an apparently uninitialised pointer since dereferencing it leads to the crash.
I am using libvlc_audio_set_format rather than libvlc_audio_set_format_callbacks.
I fixed it locally by doing this:
However, I am sure that this is *not* the right fix - I'm not sure why the cleanup pointer is not NULL here, especially since sys->setup always does seem to be NULL.
In amem.c:
Code: Select all
static void Stop (audio_output_t *aout)
{
aout_sys_t *sys = aout->sys;
if (sys->cleanup != NULL)
sys->cleanup (sys->opaque); <--- crash here
sys->ready = false;
}
I am using libvlc_audio_set_format rather than libvlc_audio_set_format_callbacks.
I fixed it locally by doing this:
Code: Select all
static void Stop (audio_output_t *aout)
{
aout_sys_t *sys = aout->sys;
if (sys->setup != NULL && sys->cleanup != NULL)
sys->cleanup (sys->opaque);
sys->ready = false;
}