[FFmpeg-cvslog] dca: Respect the current limits in the downmixing capabilities

Luca Barbato git at videolan.org
Tue Aug 27 18:02:17 CEST 2013


ffmpeg | branch: release/1.1 | Luca Barbato <lu_zero at gentoo.org> | Wed Jul 10 19:00:15 2013 +0200| [c03533ace27c9553cf716bb7a8336d258b4c2018] | committer: Luca Barbato

dca: Respect the current limits in the downmixing capabilities

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable at libav.org
(cherry picked from commit 3802833bc1f79775a1547c5e427fed6e92b77e53)

Signed-off-by: Luca Barbato <lu_zero at gentoo.org>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c03533ace27c9553cf716bb7a8336d258b4c2018
---

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

diff --git a/libavcodec/dcadec.c b/libavcodec/dcadec.c
index a2d9964..561c30c 100644
--- a/libavcodec/dcadec.c
+++ b/libavcodec/dcadec.c
@@ -809,6 +809,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])) {
+                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];



More information about the ffmpeg-cvslog mailing list