avcodec/opus: Check count of ambisonic channels

https://tools.ietf.org/html/draft-ietf-codec-ambisonics-01#section-3.1
specifies the maximum as 227

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2017-02-17 11:18:30 +01:00
parent fcf3e06fe4
commit 04e611474b
1 changed files with 4 additions and 0 deletions

View File

@ -381,6 +381,10 @@ av_cold int ff_opus_parse_extradata(AVCodecContext *avctx,
" for nonnegative integer n\n"); " for nonnegative integer n\n");
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
if (channels > 227) {
av_log(avctx, AV_LOG_ERROR, "Too many channels\n");
return AVERROR_INVALIDDATA;
}
layout = 0; layout = 0;
} else } else
layout = 0; layout = 0;