diff options
Diffstat (limited to 'libavutil/log.c')
-rw-r--r-- | libavutil/log.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/libavutil/log.c b/libavutil/log.c index 72d2b91..d7daaa2 100644 --- a/libavutil/log.c +++ b/libavutil/log.c @@ -2,20 +2,20 @@ * log functions * Copyright (c) 2003 Michel Bardiaux * - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -79,11 +79,20 @@ const char* av_default_item_name(void* ptr){ return (*(AVClass**)ptr)->class_name; } +static void sanitize(uint8_t *line){ + while(*line){ + if(*line < 0x08 || (*line > 0x0D && *line < 0x20)) + *line='?'; + line++; + } +} + 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 line[1024], prev[1024]; + static char prev[1024]; + char line[1024]; static int is_atty; AVClass* avc= ptr ? *(AVClass**)ptr : NULL; if(level>av_log_level) @@ -118,8 +127,9 @@ void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl) fprintf(stderr, " Last message repeated %d times\n", count); count=0; } - colored_fputs(av_clip(level>>3, 0, 6), line); strcpy(prev, line); + sanitize(line); + colored_fputs(av_clip(level>>3, 0, 6), line); } static void (*av_log_callback)(void*, int, const char*, va_list) = av_log_default_callback; |