avfilter/af_amerge: avoid undefined shift (<<64) in outlayout setup
authorMichael Niedermayer <michael@niedermayer.cc>
Thu, 3 Sep 2015 22:33:49 +0000 (00:33 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Sat, 5 Sep 2015 13:14:09 +0000 (15:14 +0200)
Fixes CID1322306

Reviewed-by: Ganesh Ajjanagadde <gajjanag@mit.edu>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavfilter/af_amerge.c

index 9c3cfed..410d613 100644 (file)
@@ -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;