changeset 6868:5387096bf92a libavcodec

add check for invalid channel mode when coupling is used
author jbr
date Sun, 25 May 2008 15:23:03 +0000
parents 8f656b589911
children 59ae0494b656
files ac3dec.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ac3dec.c	Sun May 25 14:07:35 2008 +0000
+++ b/ac3dec.c	Sun May 25 15:23:03 2008 +0000
@@ -818,6 +818,11 @@
             /* coupling in use */
             int cpl_begin_freq, cpl_end_freq;
 
+            if (channel_mode < AC3_CHMODE_STEREO) {
+                av_log(s->avctx, AV_LOG_ERROR, "coupling not allowed in mono or dual-mono\n");
+                return -1;
+            }
+
             /* determine which channels are coupled */
             for (ch = 1; ch <= fbw_channels; ch++)
                 s->channel_in_cpl[ch] = get_bits1(gbc);