[FFmpeg-devel] [PATCH] fix ffplay segv when audio buf is not set

Michael Niedermayer michaelni
Sat Jan 10 00:27:58 CET 2009


On Fri, Jan 09, 2009 at 03:09:58PM -0800, Baptiste Coudurier wrote:
> Hi,
> 
> $subject,
> This happens if no audio frame could be decoded at all,
> is->audio_buf will not be set, set it to audio_buf1 and add silence.
> 
> -- 
> Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
> Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
> checking for life_signs in -lkenny... no

> Index: ffplay.c
> ===================================================================
> --- ffplay.c	(revision 16508)
> +++ ffplay.c	(working copy)
> @@ -1684,6 +1684,8 @@
>             audio_size = audio_decode_frame(is, &pts);
>             if (audio_size < 0) {
>                  /* if error, just output silence */
> +               if (!is->audio_buf)
> +                   is->audio_buf = is->audio_buf1;
>                 is->audio_buf_size = 1024;
>                 memset(is->audio_buf, 0, is->audio_buf_size);
>             } else {

is the if(!is->audio_buf)) needed or can we always use audio_buf1?

either way the patch looks ok with the needed code.

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many that live deserve death. And some that die deserve life. Can you give
it to them? Then do not be too eager to deal out death in judgement. For
even the very wise cannot see all ends. -- Gandalf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090110/e0ae6fd8/attachment.pgp>



More information about the ffmpeg-devel mailing list