avutil/log: skip IO calls on empty strings
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 6 Dec 2013 22:30:34 +0000 (23:30 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 15 Jan 2014 23:35:12 +0000 (00:35 +0100)
These occur when no context is set for example, thus they are common

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a044a183a3fb90b20a8deaa3ea1158510bcdd420)

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

index 49dd4d1..bdb4be0 100644 (file)
@@ -101,6 +101,9 @@ static int use_color = -1;
 
 static void colored_fputs(int level, const char *str)
 {
+    if (!*str)
+        return;
+
     if (use_color < 0) {
 #if HAVE_SETCONSOLETEXTATTRIBUTE
         CONSOLE_SCREEN_BUFFER_INFO con_info;