Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2012-05-31 12:58:31 +0400
committerMichael Niedermayer <michaelni@gmx.at>2012-06-09 22:45:09 +0400
commitaefa2bf70a053f0fe26a2bc2342f8c8a2a43ecf0 (patch)
treeb97f7e75abb616bf30a3fd8c3075a4906150adc6
parentece27b09d6f9bc271ed19e37dcc21b7ae4db4291 (diff)
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>
-rw-r--r--libavcodec/binkaudio.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/binkaudio.c b/libavcodec/binkaudio.c
index 9f51c7a856..0c274b9e36 100644
--- a/libavcodec/binkaudio.c
+++ b/libavcodec/binkaudio.c
@@ -91,9 +91,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;
}
s->version_b = avctx->extradata && avctx->extradata[3] == 'b';