Mercurial > libavcodec.hg
comparison ac3dec.c @ 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 | f7cbb7733146 |
children | 59ae0494b656 |
comparison
equal
deleted
inserted
replaced
6867:8f656b589911 | 6868:5387096bf92a |
---|---|
816 s->cpl_in_use = get_bits1(gbc); | 816 s->cpl_in_use = get_bits1(gbc); |
817 if (s->cpl_in_use) { | 817 if (s->cpl_in_use) { |
818 /* coupling in use */ | 818 /* coupling in use */ |
819 int cpl_begin_freq, cpl_end_freq; | 819 int cpl_begin_freq, cpl_end_freq; |
820 | 820 |
821 if (channel_mode < AC3_CHMODE_STEREO) { | |
822 av_log(s->avctx, AV_LOG_ERROR, "coupling not allowed in mono or dual-mono\n"); | |
823 return -1; | |
824 } | |
825 | |
821 /* determine which channels are coupled */ | 826 /* determine which channels are coupled */ |
822 for (ch = 1; ch <= fbw_channels; ch++) | 827 for (ch = 1; ch <= fbw_channels; ch++) |
823 s->channel_in_cpl[ch] = get_bits1(gbc); | 828 s->channel_in_cpl[ch] = get_bits1(gbc); |
824 | 829 |
825 /* phase flags in use */ | 830 /* phase flags in use */ |