summaryrefslogtreecommitdiff
path: root/libavcodec/binkaudio.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2012-05-31 08:58:31 +0000
committerPaul B Mahol <onemda@gmail.com>2012-05-31 08:58:31 +0000
commit824a6975ee066e944b7a20d1e220fd8974fb6174 (patch)
treecd54ff5595fe5e3d2704aa8b3ae437163e0ab384 /libavcodec/binkaudio.c
parent8aaa00c3012d425ce50efffadb813ad62d1ff3d5 (diff)
binkaudio: check number of channels
Fixes #1380. Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavcodec/binkaudio.c')
-rw-r--r--libavcodec/binkaudio.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/binkaudio.c b/libavcodec/binkaudio.c
index eb182d14b3..ee66b8b51e 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';