aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Ross <pross@xvid.org>2011-02-15 11:58:51 +0000
committerMichael Niedermayer <michaelni@gmx.at>2011-02-15 16:32:33 +0100
commit136901567c44a653485b5e97caff4fee09424b18 (patch)
tree335bc344da8b0db62f09516b5d8a4955d3580125
parent73b3b52285db58844161a91616548b3bf9c86220 (diff)
downloadffmpeg-136901567c44a653485b5e97caff4fee09424b18.tar.gz
binkaudio: fix channel count check
Perform validity check on AVFormatContext.channels instead of uninitialised field. This fixes issue 2001. Signed-off-by: Mans Rullgard <mans@mansr.com> (cherry picked from commit 9806fbd5351fa84f99fa5b18fe06859acb514f34)
-rw-r--r--libavcodec/binkaudio.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/binkaudio.c b/libavcodec/binkaudio.c
index 53484654db..ae3db5d6c7 100644
--- a/libavcodec/binkaudio.c
+++ b/libavcodec/binkaudio.c
@@ -85,8 +85,8 @@ static av_cold int decode_init(AVCodecContext *avctx)
}
s->frame_len = 1 << frame_len_bits;
- if (s->channels > MAX_CHANNELS) {
- av_log(s->avctx, AV_LOG_ERROR, "too many channels: %d\n", s->channels);
+ if (avctx->channels > MAX_CHANNELS) {
+ av_log(s->avctx, AV_LOG_ERROR, "too many channels: %d\n", avctx->channels);
return -1;
}