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

Daniel Kang daniel.d.kang
Sat Jan 8 22:21:31 CET 2011


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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ts_channel_check.diff
Type: application/octet-stream
Size: 1658 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20110108/b440dfdb/attachment.obj>



More information about the ffmpeg-devel mailing list