binkaudio: fix channel count check
authorPeter Ross <pross@xvid.org>
Tue, 15 Feb 2011 11:58:51 +0000 (11:58 +0000)
committerMans Rullgard <mans@mansr.com>
Tue, 15 Feb 2011 14:20:19 +0000 (14:20 +0000)
Perform validity check on AVFormatContext.channels instead of
uninitialised field.

This fixes issue 2001.

Signed-off-by: Mans Rullgard <mans@mansr.com>
libavcodec/binkaudio.c

index 5348465..ae3db5d 100644 (file)
@@ -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;
     }