[FFmpeg-cvslog] binkaudio: check number of channels

Paul B Mahol git at videolan.org
Sat Jun 9 21:11:47 CEST 2012


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

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

diff --git a/libavcodec/binkaudio.c b/libavcodec/binkaudio.c
index 3b65a19..a93131d 100644
--- a/libavcodec/binkaudio.c
+++ b/libavcodec/binkaudio.c
@@ -85,9 +85,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;
     }
 
     if (avctx->extradata && avctx->extradata_size > 0)



More information about the ffmpeg-cvslog mailing list