Module: libav
Branch: release/12
Commit: 03fb0f7449de37cd32907eba5142476e988141da

Author:    Luca Barbato <lu_z...@gentoo.org>
Committer: Sean McGovern <gsean...@gmail.com>
Date:      Tue Mar 14 09:15:29 2017 +0000

dca: Validate the channel map

Having a mismatch between the number of channels in the stream and those
in the channel map will lead to a segfault or worse.

Bug-Id: 1016

CC: libav-sta...@libav.org

Signed-off-by: Luca Barbato <lu_z...@gentoo.org>
(cherry picked from commit e245d4f45ca5e2b97daef5944d63323c07d545bc)

Signed-off-by: Sean McGovern <gsean...@gmail.com>

---

 libavcodec/dcadec.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/dcadec.c b/libavcodec/dcadec.c
index cd44323..af26dce 100644
--- a/libavcodec/dcadec.c
+++ b/libavcodec/dcadec.c
@@ -1297,6 +1297,9 @@ static int set_channel_layout(AVCodecContext *avctx, int 
channels, int num_core_
                 s->channel_order_tab = ff_dca_channel_reorder_nolfe[s->amode];
         }
 
+        if (channels < ff_dca_channels[s->amode])
+            return AVERROR_INVALIDDATA;
+
         if (channels > !!s->lfe &&
             s->channel_order_tab[channels - 1 - !!s->lfe] < 0)
             return AVERROR_INVALIDDATA;

_______________________________________________
libav-commits mailing list
libav-commits@libav.org
https://lists.libav.org/mailman/listinfo/libav-commits

Reply via email to