Module: libav
Branch: release/0.8
Commit: 521cbcb7d37fa12bf1038d1a73bbabcbf62589ed

Author:    Luca Barbato <[email protected]>
Committer: Luca Barbato <[email protected]>
Date:      Wed Jul 10 19:00:15 2013 +0200

dca: Respect the current limits in the downmixing capabilities

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: [email protected]
(cherry picked from commit 3802833bc1f79775a1547c5e427fed6e92b77e53)

Signed-off-by: Luca Barbato <[email protected]>

---

 libavcodec/dca.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/libavcodec/dca.c b/libavcodec/dca.c
index 61a056e..169c9b4 100644
--- a/libavcodec/dca.c
+++ b/libavcodec/dca.c
@@ -805,6 +805,13 @@ static int dca_subframe_header(DCAContext *s, int 
base_channel, int block_index)
                        "Invalid channel mode %d\n", am);
                 return AVERROR_INVALIDDATA;
             }
+
+            if (s->prim_channels > FF_ARRAY_ELEMS(dca_default_coeffs[0])) {
+                av_log_ask_for_sample(s->avctx, "Downmixing %d channels",
+                                      s->prim_channels);
+                return AVERROR_PATCHWELCOME;
+            }
+
             for (j = base_channel; j < s->prim_channels; j++) {
                 s->downmix_coef[j][0] = dca_default_coeffs[am][j][0];
                 s->downmix_coef[j][1] = dca_default_coeffs[am][j][1];

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

Reply via email to