]> git.sesse.net Git - x264/commitdiff
Fix masked access violation in KERNEL32
authorAnton Mitrofanov <BugMaster@narod.ru>
Mon, 26 Aug 2013 17:20:31 +0000 (21:20 +0400)
committerFiona Glaser <fiona@x264.com>
Mon, 26 Aug 2013 17:48:02 +0000 (10:48 -0700)
Caused crashes under gdb in Windows and might cause other unknown problems.

common/osdep.c

index 6952dd0a6e30e494b89d33bdf4f9cf07ac546659..7564f654cb687a86a3e943aa3b57883d53a7c25d 100644 (file)
@@ -192,7 +192,8 @@ int x264_vfprintf( FILE *stream, const char *format, va_list arg )
         {
             /* WriteConsoleW is the most reliable way to output Unicode to a console. */
             int length_utf16 = MultiByteToWideChar( CP_UTF8, 0, buf, length, buf_utf16, sizeof(buf_utf16)/sizeof(wchar_t) );
-            WriteConsoleW( console, buf_utf16, length_utf16, NULL, NULL );
+            DWORD written;
+            WriteConsoleW( console, buf_utf16, length_utf16, &written, NULL );
             return length;
         }
     }