Browse code

log: Fix an oob array read.

Alex Converse authored on 2011/05/06 14:33:31
Showing 1 changed files
... ...
@@ -104,7 +104,7 @@ void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl)
104 104
 
105 105
     vsnprintf(line + strlen(line), sizeof(line) - strlen(line), fmt, vl);
106 106
 
107
-    print_prefix= line[strlen(line)-1] == '\n';
107
+    print_prefix = strlen(line) && line[strlen(line)-1] == '\n';
108 108
 
109 109
 #if HAVE_ISATTY
110 110
     if(!is_atty) is_atty= isatty(2) ? 1 : -1;