dca: Account for lfe when checking for the channel count
authorLuca Barbato <lu_zero@gentoo.org>
Mon, 17 Apr 2017 12:53:14 +0000 (12:53 +0000)
committerSean McGovern <gseanmcg@gmail.com>
Wed, 19 Apr 2017 21:55:42 +0000 (17:55 -0400)
Bug-Id: 1037
CC: libav-stable@libav.org
libavcodec/dcadec.c

index ed1ed2d..3fe46cd 100644 (file)
@@ -1300,7 +1300,7 @@ static int set_channel_layout(AVCodecContext *avctx, int channels)
                 s->channel_order_tab = ff_dca_channel_reorder_nolfe[s->amode];
         }
 
-        if (channels < ff_dca_channels[s->amode])
+        if (channels < ff_dca_channels[s->amode] + !!s->lfe)
             return AVERROR_INVALIDDATA;
 
         if (channels > !!s->lfe &&