[vlc-commits] win32text: fix encoding

Rémi Denis-Courmont git at videolan.org
Sat Jan 28 16:36:42 CET 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Jan 28 17:19:47 2012 +0200| [ffe8bf50c3b5ab0539e4967451120d095814a693] | committer: Rémi Denis-Courmont

win32text: fix encoding

This was broken ever since VLC was switched to UTF-8.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ffe8bf50c3b5ab0539e4967451120d095814a693
---

 modules/text_renderer/win32text.c |   14 ++------------
 1 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/modules/text_renderer/win32text.c b/modules/text_renderer/win32text.c
index ccfc412..a4adde1 100644
--- a/modules/text_renderer/win32text.c
+++ b/modules/text_renderer/win32text.c
@@ -314,19 +314,9 @@ static int RenderText( filter_t *p_filter, subpicture_region_t *p_region_out,
     if( !p_region_in->psz_text || !*p_region_in->psz_text )
         return VLC_EGENERIC;
 
-    psz_string = malloc( (strlen( p_region_in->psz_text )+1) * sizeof(TCHAR) );
-    if( !psz_string )
-        return VLC_ENOMEM;
-#ifdef UNICODE
-    if( mbstowcs( psz_string, p_region_in->psz_text,
-                  strlen( p_region_in->psz_text ) * sizeof(TCHAR) ) < 0 )
-    {
-        free( psz_string );
+    psz_string = ToT(p_region_in->psz_text);
+    if( psz_string == NULL )
         return VLC_EGENERIC;
-    }
-#else
-    strcpy( psz_string, p_region_in->psz_text );
-#endif
     if( !*psz_string )
     {
         free( psz_string );



More information about the vlc-commits mailing list