[FFmpeg-cvslog] vorbisdec: reject channel mapping with less than two channels
Andreas Cadhalpun
git at videolan.org
Thu Jan 28 02:27:23 CET 2016
ffmpeg | branch: release/2.5 | Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com> | Sun Jan 3 19:20:54 2016 +0100| [b6fb6ccda40a3dd13784e4811ba7da1587fab64b] | committer: Andreas Cadhalpun
vorbisdec: reject channel mapping with less than two channels
It causes the angle channel number to equal the magnitude channel
number, which makes the stream undecodable according to the
specification.
Reviewed-by: Michael Niedermayer <michael at niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
(cherry picked from commit b4b13848dec5420fa5dd9e1a7d4dfae5de1932d5)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b6fb6ccda40a3dd13784e4811ba7da1587fab64b
---
libavcodec/vorbisdec.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/libavcodec/vorbisdec.c b/libavcodec/vorbisdec.c
index fb16099..a42b803 100644
--- a/libavcodec/vorbisdec.c
+++ b/libavcodec/vorbisdec.c
@@ -784,6 +784,11 @@ static int vorbis_parse_setup_hdr_mappings(vorbis_context *vc)
if (get_bits1(gb)) {
mapping_setup->coupling_steps = get_bits(gb, 8) + 1;
+ if (vc->audio_channels < 2) {
+ av_log(vc->avctx, AV_LOG_ERROR,
+ "Square polar channel mapping with less than two channels is not compliant with the Vorbis I specification.\n");
+ return AVERROR_INVALIDDATA;
+ }
mapping_setup->magnitude = av_mallocz(mapping_setup->coupling_steps *
sizeof(*mapping_setup->magnitude));
mapping_setup->angle = av_mallocz(mapping_setup->coupling_steps *
More information about the ffmpeg-cvslog
mailing list