1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-03-28 12:32:17 +02:00

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)
This commit is contained in:
Peter Ross 2011-02-15 11:58:51 +00:00 committed by Michael Niedermayer
parent 73b3b52285
commit 136901567c

View 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;
}