[FFmpeg-devel] [PATCH] SIPR: kill variable-length arrays

Måns Rullgård mans
Tue Jan 12 23:13:46 CET 2010


Yuriy Kaminskiy <yumkam at mail.ru> writes:

> On 12.01.2010 23:35, Mans Rullgard wrote:
>> Two of these are in fact constant size, so use the constant instead of
>> a variable in the declarations.  The remaining one is small enough
>> that always using the maximum size is acceptable.
>> diff --git a/libavcodec/sipr.c b/libavcodec/sipr.c
>> index 7bfa3ab..7110c0f 100644
>> @@ -409,7 +411,7 @@ static void decode_frame(SiprContext *ctx, SiprParameters *params,
>>  {
>>      int i, j;
>>      int frame_size = ctx->m.subframe_count * SUBFR_SIZE;
>> -    float Az[LP_FILTER_ORDER * ctx->m.subframe_count];
>> +    float Az[LP_FILTER_ORDER * MAX_SUBFRAME_COUNT * SUBFR_SIZE];
>
> s/\* SUBFR_SIZE// ? it was .subframe_count before, not frame_size

Must have had it mixed up in my head with the other function.

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



More information about the ffmpeg-devel mailing list