On Wed, 10 Jul 2013, Luca Barbato wrote:

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-sta...@libav.org
---
libavcodec/dcadec.c | 6 ++++++
1 file changed, 6 insertions(+)

Perhaps s/Report/Respect/ in the commit subject?


diff --git a/libavcodec/dcadec.c b/libavcodec/dcadec.c
index de24e4e..9b00d30 100644
--- a/libavcodec/dcadec.c
+++ b/libavcodec/dcadec.c
@@ -807,6 +807,12 @@ 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])) {
+                avpriv_request_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];
--
1.8.2.1

Looks good to me although I'm not familiar with the decoder.

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

Reply via email to