diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2008-05-25 15:23:03 +0000 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2008-05-25 15:23:03 +0000 |
commit | 3af91313983b54d76aadda0f80ef7fc72aa9d5cf (patch) | |
tree | 0eeb1499cc03c8ff498cdd1980f91b465d7dceea /libavcodec | |
parent | e188cb70d806d63895939d960a8d4435061503cb (diff) | |
download | ffmpeg-3af91313983b54d76aadda0f80ef7fc72aa9d5cf.tar.gz |
add check for invalid channel mode when coupling is used
Originally committed as revision 13381 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/ac3dec.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c index 257687ec12..ae9f2eafb2 100644 --- a/libavcodec/ac3dec.c +++ b/libavcodec/ac3dec.c @@ -818,6 +818,11 @@ static int ac3_parse_audio_block(AC3DecodeContext *s, int blk) /* 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); |