aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil
diff options
context:
space:
mode:
authorWolfram Gloger <wmglo@dent.med.uni-muenchen.de>2012-06-22 18:15:09 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-06-22 19:16:51 +0200
commit258dfff8394d383beaa639d19912b3f068f67e16 (patch)
tree04a56b3eebee8f34c982df62d88a7c667fd883f1 /libavutil
parent1e7943c3151d7c27416c88249900af56919bc1db (diff)
downloadffmpeg-258dfff8394d383beaa639d19912b3f068f67e16.tar.gz
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>
Diffstat (limited to 'libavutil')
-rw-r--r--libavutil/log.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/libavutil/log.c b/libavutil/log.c
index c9c0922c9e..f2272fb648 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];