FATE/bprint: Convert a VLA to a normal array
authorDerek Buitenhuis <derek.buitenhuis@gmail.com>
Tue, 11 Sep 2012 21:23:47 +0000 (17:23 -0400)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 12 Sep 2012 03:22:46 +0000 (05:22 +0200)
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Reviewed-by: Nicolas George <nicolas.george@normalesup.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavutil/bprint.c

index 6e59f6b..08231d2 100644 (file)
@@ -21,6 +21,7 @@
 #include <stdarg.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdarg.h>
 #include <stdio.h>
 #include <string.h>
+#include "avassert.h"
 #include "bprint.h"
 #include "common.h"
 #include "error.h"
 #include "bprint.h"
 #include "common.h"
 #include "error.h"
@@ -189,7 +190,10 @@ int av_bprint_finalize(AVBPrint *buf, char **ret_str)
 
 static void bprint_pascal(AVBPrint *b, unsigned size)
 {
 
 static void bprint_pascal(AVBPrint *b, unsigned size)
 {
-    unsigned p[size + 1], i, j;
+    unsigned i, j;
+    unsigned p[42];
+
+    av_assert0(size < FF_ARRAY_ELEMS(p));
 
     p[0] = 1;
     av_bprintf(b, "%8d\n", 1);
 
     p[0] = 1;
     av_bprintf(b, "%8d\n", 1);