[FFmpeg-devel] [PATCH] add check for invalid number of channels for ts (issue 2505)

Daniel Kang daniel.d.kang
Fri Jan 14 19:40:29 CET 2011


On Sat, Jan 8, 2011 at 4:21 PM, Daniel Kang <daniel.d.kang at gmail.com> wrote:

>  On Sat, Jan 8, 2011 at 3:38 PM, Justin Ruggles <justin.ruggles at gmail.com>wrote:
>
>>  On 01/08/2011 02:20 PM, Daniel Kang wrote:
>>
>> > On Fri, Jan 7, 2011 at 8:03 AM, Daniel Kang <daniel.d.kang at gmail.com>
>> wrote:
>> >
>> >> For ts files with an invalid number of channels, ffmpeg crashes with a
>> >> buffer overread. The patch attached adds a check for an invalid number
>> >> of channels.
>> >
>> >
>> > Thanks to Benjamin Larsson, I have updated the patch to fix this issue
>> > in a better way.
>>
>>
>> > +    if (avctx->channels != channels) {
>> > +        av_log(avctx, AV_LOG_ERROR, "ffmpeg does not support number of
>> channels changing in stream. Skipping frame.\n");
>> > +        return -1;
>> > +    }
>>
>>
>> This is not a true statement unless you're referring to ffmpeg the
>> application, not FFmpeg in general.  If you're referring to the
>> application, that should not be a reason to do something in libavcodec.
>>  For example, the AC3 decoder can handle the number of channels changing
>> mid-stream in some cases.  Maybe this should just say that the DCA
>> decoder does not support the number of channels changing mid-stream.
>>
>> -Justin
>
>
> I have updated the comment.
>

Are there any more comments or can this be committed?



More information about the ffmpeg-devel mailing list