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

Baptiste Coudurier baptiste.coudurier
Sat Jan 10 00:55:33 CET 2009


Hi Michael,

Michael Niedermayer wrote:
> 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.
>>
>> --- 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.
> 

Good idea, removed the if and applied.

-- 
Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
checking for life_signs in -lkenny... no




More information about the ffmpeg-devel mailing list