avutil/log: fix negative log levels
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 3 Apr 2014 20:42:24 +0000 (22:42 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 3 Apr 2014 20:44:04 +0000 (22:44 +0200)
These where broken by 7763118cae4eb468b032dbd29af15a011c2c233b

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavutil/log.c

index 843d2e9..d40be2b 100644 (file)
@@ -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;