From 258dfff8394d383beaa639d19912b3f068f67e16 Mon Sep 17 00:00:00 2001
From: Wolfram Gloger <wmglo@dent.med.uni-muenchen.de>
Date: Fri, 22 Jun 2012 18:15:09 +0200
Subject: [PATCH] extend log line buffer sizes

The string passed to av_vlog() from libx264's X264_log overflows the 512
byte part_size, truncating x264 parameter output.  Double this size
and put it in a #define so it only needs to be changed in one place.

Signed-off-by: Wolfram Gloger <video06@malloc.de>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
---
 libavutil/log.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/libavutil/log.c b/libavutil/log.c
index c9c0922c9eb..f2272fb6484 100644
--- a/libavutil/log.c
+++ b/libavutil/log.c
@@ -29,6 +29,8 @@
 #include "avutil.h"
 #include "log.h"
 
+#define LINE_SZ 1024
+
 static int av_log_level = AV_LOG_INFO;
 static int flags;
 
@@ -148,7 +150,7 @@ static int get_category(void *ptr){
 }
 
 static void format_line(void *ptr, int level, const char *fmt, va_list vl,
-                        char part[3][512], int part_size, int *print_prefix, int type[2])
+                        char part[3][LINE_SZ], int part_size, int *print_prefix, int type[2])
 {
     AVClass* avc = ptr ? *(AVClass **) ptr : NULL;
     part[0][0] = part[1][0] = part[2][0] = 0;
@@ -176,7 +178,7 @@ static void format_line(void *ptr, int level, const char *fmt, va_list vl,
 void av_log_format_line(void *ptr, int level, const char *fmt, va_list vl,
                         char *line, int line_size, int *print_prefix)
 {
-    char part[3][512];
+    char part[3][LINE_SZ];
     format_line(ptr, level, fmt, vl, part, sizeof(part[0]), print_prefix, NULL);
     snprintf(line, line_size, "%s%s%s", part[0], part[1], part[2]);
 }
@@ -185,9 +187,9 @@ void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl)
 {
     static int print_prefix = 1;
     static int count;
-    static char prev[1024];
-    char part[3][512];
-    char line[1024];
+    static char prev[LINE_SZ];
+    char part[3][LINE_SZ];
+    char line[LINE_SZ];
     static int is_atty;
     int type[2];
 
-- 
GitLab