diff --git a/libavutil/log.c b/libavutil/log.c index 843d2e91eb..d40be2bc55 100644 --- a/libavutil/log.c +++ b/libavutil/log.c @@ -258,10 +258,12 @@ void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl) char line[LINE_SZ]; static int is_atty; int type[2]; - unsigned tint = level & 0xff00; - - level &= 0xff; + unsigned tint = 0; + if (level >= 0) { + tint = level & 0xff00; + level &= 0xff; + } if (level > av_log_level) return;