[FFmpeg-devel] [PATCH] adpcm: convert VLAs to malloc/free

Måns Rullgård mans
Sun Jun 27 04:51:05 CEST 2010


Michael Niedermayer <michaelni at gmx.at> writes:

> On Sun, Jun 27, 2010 at 02:20:19AM +0100, M?ns Rullg?rd wrote:
>> Michael Niedermayer <michaelni at gmx.at> writes:
>> 
>> > On Sun, Jun 27, 2010 at 01:40:38AM +0100, M?ns Rullg?rd wrote:
>> >> Michael Niedermayer <michaelni at gmx.at> writes:
>> >> 
>> >> > On Wed, Jun 23, 2010 at 08:49:53PM +0100, Mans Rullgard wrote:
>> >> >> ---
>> >> >>  libavcodec/adpcm.c |  136 +++++++++++++++++++++++++++++++---------------------
>> >> >>  1 files changed, 82 insertions(+), 54 deletions(-)
>> >> >
>> >> > mixes functional and cosmetic changes
>> >> 
>> >> No, moving the structs is necessary.
>> >
>> > that may be but i dont think moving the structs needs the rest of the changes
>> 
>> Well, no.. but splitting this would be just plain silly.  I agree that
>> indentation changes make the diff harder to read, but not this.
>> 
>> > that said the removial of VLAs here does lead to ugly code
>> > ... iam not really happy about it.
>> 
>> The code is exactly as ugly as what the compiler has to do otherwise.
>
> certainly true, but one normally doesnt have to read what the compiler
> generates

I removed the dangerous VLAs in the most straight-forward way.
Anything else would require major restructuring of the code, I'm
afraid.

>> What do you suggest instead?  The code as is uses up to 12MB of stack
>
> i suggest we ask the author of the code, maybe he has a suggestion

Seems like that was Loren.  I was hoping it would have been you :-)

Can I at least apply the parts of the patch don't deal with these ugly
arrays?

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



More information about the ffmpeg-devel mailing list