[FFmpeg-devel] [PATCH 3/3] FATE/bprint: Convert a VLA to a normal array

Nicolas George nicolas.george at normalesup.org
Tue Sep 11 22:55:30 CEST 2012

Le sextidi 26 fructidor, an CCXX, Derek Buitenhuis a écrit :
> -static void bprint_pascal(AVBPrint *b, unsigned size)
> +static void bprint_pascal(AVBPrint *b, unsigned *p, unsigned size)
>  {
> -    unsigned p[size + 1], i, j;
> +    unsigned i, j;

It would probably be slightly simpler to just write:

unsigned p[42];
av_assert0(size < FF_ARRAY_ELEMS(p));

It is a test program, after all, arbitrary limitations in computing the
Pascal triangle are not really an issue (and that was also the reason I used
a VLA in the first place).

Either way ok.


  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120911/0f050468/attachment.asc>

More information about the ffmpeg-devel mailing list