[FFmpeg-cvslog] binkaudio: check number of channels
Paul B Mahol
git at videolan.org
Thu Jun 7 01:44:17 CEST 2012
ffmpeg | branch: release/0.11 | Paul B Mahol <onemda at gmail.com> | Thu May 31 08:58:31 2012 +0000| [d3d6849d1797ddf25ed3e337c9c79a242669d583] | committer: Michael Niedermayer
binkaudio: check number of channels
Fixes #1380.
Signed-off-by: Paul B Mahol <onemda at gmail.com>
(cherry picked from commit 824a6975ee066e944b7a20d1e220fd8974fb6174)
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d3d6849d1797ddf25ed3e337c9c79a242669d583
---
libavcodec/binkaudio.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/libavcodec/binkaudio.c b/libavcodec/binkaudio.c
index eb182d1..ee66b8b 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';
More information about the ffmpeg-cvslog
mailing list