[FFmpeg-cvslog] FATE/bprint: Convert a VLA to a normal array
Derek Buitenhuis
git at videolan.org
Wed Sep 12 05:26:16 CEST 2012
ffmpeg | branch: master | Derek Buitenhuis <derek.buitenhuis at gmail.com> | Tue Sep 11 17:23:47 2012 -0400| [0c5fe2f0dabfb4931e9663fa0c612df31554e67f] | committer: Michael Niedermayer
FATE/bprint: Convert a VLA to a normal array
Signed-off-by: Derek Buitenhuis <derek.buitenhuis at gmail.com>
Reviewed-by: Nicolas George <nicolas.george at normalesup.org>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0c5fe2f0dabfb4931e9663fa0c612df31554e67f
---
libavutil/bprint.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/libavutil/bprint.c b/libavutil/bprint.c
index 6e59f6b..08231d2 100644
--- a/libavutil/bprint.c
+++ b/libavutil/bprint.c
@@ -21,6 +21,7 @@
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
+#include "avassert.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)
{
- 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);
More information about the ffmpeg-cvslog
mailing list