[FFmpeg-devel] [PATCH] avfilter/af_amerge: avoid undefined shift (<<64) in outlayout setup

Ganesh Ajjanagadde gajjanag at mit.edu
Fri Sep 4 01:09:05 CEST 2015


On Thu, Sep 3, 2015 at 3:33 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
> From: Michael Niedermayer <michael at niedermayer.cc>
>
> Fixes CID1322306
>
> Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> ---
>  libavfilter/af_amerge.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libavfilter/af_amerge.c b/libavfilter/af_amerge.c
> index 9c3cfed..410d613 100644
> --- a/libavfilter/af_amerge.c
> +++ b/libavfilter/af_amerge.c
> @@ -110,8 +110,8 @@ static int query_formats(AVFilterContext *ctx)
>          for (i = 0; i < nb_ch; i++)
>              s->route[i] = i;
>          outlayout = av_get_default_channel_layout(nb_ch);
> -        if (!outlayout)
> -            outlayout = ((int64_t)1 << nb_ch) - 1;
> +        if (!outlayout && nb_ch)
> +            outlayout = 0xFFFFFFFFFFFFFFFFULL >> (64 - nb_ch);
>      } else {
>          int *route[SWR_CH_MAX];
>          int c, out_ch_number = 0;
> --
> 1.7.9.5

LGTM

>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


More information about the ffmpeg-devel mailing list