Bug-Id: 1016

CC: [email protected]
---

Probably there is a smarter way.

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

diff --git a/libavcodec/dcadec.c b/libavcodec/dcadec.c
index be277d2..689dfa9 100644
--- a/libavcodec/dcadec.c
+++ b/libavcodec/dcadec.c
@@ -1299,6 +1299,11 @@ static int set_channel_layout(AVCodecContext *avctx, int 
channels, int num_core_
                 s->channel_order_tab = ff_dca_channel_reorder_nolfe[s->amode];
         }

+        for (i = 0; i < channels; i++) {
+            if (s->channel_order_tab[i] >= channels)
+                return AVERROR_INVALIDDATA;
+        }
+
         if (channels > !!s->lfe &&
             s->channel_order_tab[channels - 1 - !!s->lfe] < 0)
             return AVERROR_INVALIDDATA;
--
2.10.1

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to