[FFmpeg-devel] [PATCH] binkaudio: perform validity check on AVFormatContext.channels, instead of uninitialised field

Måns Rullgård mans
Tue Feb 15 14:47:16 CET 2011


Kostya <kostya.shishkov at gmail.com> writes:

> On Tue, Feb 15, 2011 at 10:58:51PM +1100, Peter Ross wrote:
>> This fixes issue 2001.
>> ---
>>  libavcodec/binkaudio.c |    4 ++--
>>  1 files changed, 2 insertions(+), 2 deletions(-)
>> 
>> diff --git a/libavcodec/binkaudio.c b/libavcodec/binkaudio.c
>> index 5348465..ae3db5d 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;
>>      }
>>  
>> -- 
>> 1.7.1
>
> ok

Queued.

-- 
M?ns Rullg?rd
mans at mansr.com



More information about the ffmpeg-devel mailing list