Browse Source

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>
tags/n0.8
Peter Ross Mans Rullgard 14 years ago
parent
commit
9806fbd535
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      libavcodec/binkaudio.c

+ 2
- 2
libavcodec/binkaudio.c View File

@@ -85,8 +85,8 @@ static av_cold int decode_init(AVCodecContext *avctx)
} }
s->frame_len = 1 << frame_len_bits; 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; return -1;
} }




Loading…
Cancel
Save