[FFmpeg-devel] [PATCH] Fix termination of mov_ch_layouts_wav array lookup

Thierry Foucu tfoucu at gmail.com
Tue Mar 19 04:38:56 CET 2013


On Mon, Mar 18, 2013 at 4:10 PM, Clément Bœsch <ubitux at gmail.com> wrote:

> On Mon, Mar 18, 2013 at 02:00:23PM -0700, Thierry Foucu wrote:
> > Problem found using ASAN.
> > In some case, the ff_mov_get_channel_layout_tag function will not find 0
> > as termination for lookup in the array mov_ch_layouts_wav.
> > ---
> >  libavformat/mov_chan.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/libavformat/mov_chan.c b/libavformat/mov_chan.c
> > index cf1f839..7078b4a 100644
> > --- a/libavformat/mov_chan.c
> > +++ b/libavformat/mov_chan.c
> > @@ -426,6 +426,7 @@ static const enum MovChannelLayoutTag
> mov_ch_layouts_wav[] = {
> >      MOV_CH_LAYOUT_MPEG_7_1_A,
> >      MOV_CH_LAYOUT_MPEG_7_1_C,
> >      MOV_CH_LAYOUT_SMPTE_DTV,
> > +    0,
> >  };
> >
> >  static const struct {
>
> Isn't it missing in mov_ch_layout_map as well by the way?


if i read the code correctly, the access of mov_ch_layout_map is always
after check for the number of channels

if (channels > 9)
channels = 0;
layout_map = mov_ch_layout_map[channels];

So, I will say, it is not missing..



> --
> Clément B.
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
>


More information about the ffmpeg-devel mailing list