dca: Account for lfe when checking for the channel count

Message ID 20170419215634.984595DB1C@aruru.libav.org
State New
Headers show

Commit Message

Janne Grunau April 19, 2017, 9:56 p.m.
Module: libav
Branch: master
Commit: 5352802da81f2083e65d466612e639a4e6e5530e

Author:    Luca Barbato <lu_zero@gentoo.org>
Committer: Sean McGovern <gseanmcg@gmail.com>
Date:      Mon Apr 17 12:53:14 2017 +0000

dca: Account for lfe when checking for the channel count

Bug-Id: 1037
CC: libav-stable@libav.org

---

 libavcodec/dcadec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/libavcodec/dcadec.c b/libavcodec/dcadec.c
index ed1ed2d..3fe46cd 100644
--- a/libavcodec/dcadec.c
+++ b/libavcodec/dcadec.c
@@ -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 &&