[FFmpeg-cvslog] r22715 - trunk/libavcodec/bitstream.c

Måns Rullgård mans
Wed May 5 03:18:42 CEST 2010


Uoti Urpala <uoti.urpala at pp1.inet.fi> writes:

>> Variable-length arrays on the stack are inherently unsafe.  You can't
>> possibly know where your stack ends, so no checking will ever be
>> sufficient.
>
> If you insist on such an impractical "you can't be absolutely certain
> about anything" attitude then you can't do _any_ operations involving
> the stack. There's no qualitative difference between variable-length
> arrays and any other stack use in this regard.

If functions always allocate a bounded amount of stack space, and
there is no recursion, static call graph analysis can easily give an
upper bound for the stack space required.  As soon as a frame size
depends on runtime data, this becomes impossible.

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



More information about the ffmpeg-cvslog mailing list