Page 1 of 1

libvlc audio callbacks crash

Posted: 30 Jun 2013 13:56
by sherington
I have been using the audio callbacks and encountered a crash. It is repeatable 100% of the time for me.

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; }
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:

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; }
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.

Re: libvlc audio callbacks crash

Posted: 30 Jun 2013 18:15
by RĂ©mi Denis-Courmont
Yeah this was a bug. It should be fixed now.

Re: libvlc audio callbacks crash

Posted: 30 Jun 2013 20:06
by sherington
Works great now, thanks.