libvlc audio callbacks crash

This forum is about all development around libVLC.
sherington
Cone that earned his stripes
Cone that earned his stripes
Posts: 491
Joined: 10 Sep 2008 11:57
VLC version: master
Operating System: Linux

libvlc audio callbacks crash

Postby sherington » 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:

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.

Rémi Denis-Courmont
Developer
Developer
Posts: 15139
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: libvlc audio callbacks crash

Postby Rémi Denis-Courmont » 30 Jun 2013 18:15

Yeah this was a bug. It should be fixed now.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

sherington
Cone that earned his stripes
Cone that earned his stripes
Posts: 491
Joined: 10 Sep 2008 11:57
VLC version: master
Operating System: Linux

Re: libvlc audio callbacks crash

Postby sherington » 30 Jun 2013 20:06

Works great now, thanks.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 3 guests