From a3ad51e0d5b3ff6634c1be6322ce82c17105e82b Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Fri, 4 Sep 2015 00:33:49 +0200 Subject: [PATCH] avfilter/af_amerge: avoid undefined shift (<<64) in outlayout setup Fixes CID1322306 Reviewed-by: Ganesh Ajjanagadde Signed-off-by: Michael Niedermayer --- 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 9c3cfed9f4..410d6134d7 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;