[vlc-devel] [vlc-commits] audiounit: fix crash

David Fuhrmann david.fuhrmann at gmail.com
Mon Dec 2 17:59:37 CET 2013


Am 02.12.2013 um 17:14 schrieb Felix Paul Kühne <git at videolan.org>:

> vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Mon Dec  2 17:14:18 2013 +0100| [e426d8e52529904227d19b932b228b6c04c71acf] | committer: Felix Paul Kühne
> 
> audiounit: fix crash
> 
>> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e426d8e52529904227d19b932b228b6c04c71acf
> ---
> 
> modules/audio_output/audiounit_ios.c |    2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/modules/audio_output/audiounit_ios.c b/modules/audio_output/audiounit_ios.c
> index 163b9a6..a7d7fa2 100644
> --- a/modules/audio_output/audiounit_ios.c
> +++ b/modules/audio_output/audiounit_ios.c
> @@ -396,7 +396,7 @@ static OSStatus RenderCallback(vlc_object_t *p_obj,
>     Float32 *buffer = TPCircularBufferTail(&p_sys->circular_buffer, &availableBytes);
> 
>     /* check if we have enough data */
> -    if (!availableBytes || p_sys->b_paused) {
> +    if (!availableBytes || p_sys->b_paused ||!buffer) {
>         /* return an empty buffer so silence is played until we have data */
>         memset(targetBuffer, 0, ioData->mBuffers[0].mDataByteSize);

Hi Felix,

The problem is that the circular buffer is not initialized before audio unit is started. So, it is better to just fix initialization order.
Otherwise, CircularBufferTail might return garbage value != NULL, and this check will not suffice.

Cheers,
David


More information about the vlc-devel mailing list