Merge commit '3802833bc1f79775a1547c5e427fed6e92b77e53'
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 12 Jul 2013 12:42:00 +0000 (14:42 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 12 Jul 2013 12:49:27 +0000 (14:49 +0200)
* commit '3802833bc1f79775a1547c5e427fed6e92b77e53':
  dca: Respect the current limits in the downmixing capabilities

Conflicts:
libavcodec/dcadec.c

See: 8e77c3846e91b1af9df4084736257d9899156eef

Merged-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/dcadec.c

index d1612e2..dec7e28 100644 (file)
@@ -968,7 +968,13 @@ static int dca_subframe_header(DCAContext *s, int base_channel, int block_index)
                        "Invalid channel mode %d\n", am);
                 return AVERROR_INVALIDDATA;
             }
-            for (j = base_channel; j < FFMIN(s->prim_channels, FF_ARRAY_ELEMS(dca_default_coeffs[am])); j++) {
+            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];
             }