[FFmpeg-cvslog] binkaudio: check number of channels
Paul B Mahol
git at videolan.org
Thu May 31 11:22:07 CEST 2012
ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Thu May 31 08:58:31 2012 +0000| [824a6975ee066e944b7a20d1e220fd8974fb6174] | committer: Paul B Mahol
binkaudio: check number of channels
Fixes #1380.
Signed-off-by: Paul B Mahol <onemda at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=824a6975ee066e944b7a20d1e220fd8974fb6174
---
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