[FFmpeg-cvslog] binkaudio: check number of channels

Paul B Mahol git at videolan.org
Sat Jun 9 21:05:15 CEST 2012


ffmpeg | branch: release/0.10 | Paul B Mahol <onemda at gmail.com> | Thu May 31 08:58:31 2012 +0000| [aefa2bf70a053f0fe26a2bc2342f8c8a2a43ecf0] | 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=aefa2bf70a053f0fe26a2bc2342f8c8a2a43ecf0
---

 libavcodec/binkaudio.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/binkaudio.c b/libavcodec/binkaudio.c
index 9f51c7a..0c274b9 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