diff options
author | Paul B Mahol <onemda@gmail.com> | 2012-05-31 08:58:31 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-06-09 21:07:22 +0200 |
commit | 8502b4aef68b7f5c06018f18c89a2fd6586f3b79 (patch) | |
tree | a76c402d8ac514e2a2b676bc93f53276a1fbd028 /libavcodec/binkaudio.c | |
parent | 03e404740eb13d0483cc0a3e685802fdd79c1bae (diff) | |
download | ffmpeg-8502b4aef68b7f5c06018f18c89a2fd6586f3b79.tar.gz |
binkaudio: check number of channels
Fixes #1380.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
(cherry picked from commit 824a6975ee066e944b7a20d1e220fd8974fb6174)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/binkaudio.c')
-rw-r--r-- | libavcodec/binkaudio.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/binkaudio.c b/libavcodec/binkaudio.c index 3b65a19261..a93131dcbb 100644 --- a/libavcodec/binkaudio.c +++ b/libavcodec/binkaudio.c @@ -85,9 +85,9 @@ static av_cold int decode_init(AVCodecContext *avctx) frame_len_bits = 11; } - if (avctx->channels > MAX_CHANNELS) { - av_log(avctx, AV_LOG_ERROR, "too many channels: %d\n", avctx->channels); - return -1; + if (avctx->channels < 1 || avctx->channels > MAX_CHANNELS) { + av_log(avctx, AV_LOG_ERROR, "invalid number of channels: %d\n", avctx->channels); + return AVERROR_INVALIDDATA; } if (avctx->extradata && avctx->extradata_size > 0) |