Browse code

avfilter/af_amerge: avoid undefined shift (<<64) in outlayout setup

Fixes CID1322306

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

Michael Niedermayer authored on 2015/09/04 07:33:49
Showing 1 changed files
... ...
@@ -110,8 +110,8 @@ static int query_formats(AVFilterContext *ctx)
110 110
         for (i = 0; i < nb_ch; i++)
111 111
             s->route[i] = i;
112 112
         outlayout = av_get_default_channel_layout(nb_ch);
113
-        if (!outlayout)
114
-            outlayout = ((int64_t)1 << nb_ch) - 1;
113
+        if (!outlayout && nb_ch)
114
+            outlayout = 0xFFFFFFFFFFFFFFFFULL >> (64 - nb_ch);
115 115
     } else {
116 116
         int *route[SWR_CH_MAX];
117 117
         int c, out_ch_number = 0;