[vlc-devel] commit: quartztext: fix a crash when we tried to find the lenght of a CFString that was not created . (Derk-Jan Hartman )

git version control git at videolan.org
Wed Aug 13 23:41:10 CEST 2008


vlc | branch: master | Derk-Jan Hartman <hartman at videolan.org> | Wed Aug 13 23:42:35 2008 +0200| [a4bb485ff77457762b2510d4d59c874eb6c37b2c] | committer: Derk-Jan Hartman 

quartztext: fix a crash when we tried to find the lenght of a CFString that was not created.

(Another bug fixed due to the great new apple-bugreport mailinglist)

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

 modules/misc/quartztext.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/modules/misc/quartztext.c b/modules/misc/quartztext.c
index d21dfbc..27517e4 100644
--- a/modules/misc/quartztext.c
+++ b/modules/misc/quartztext.c
@@ -365,6 +365,9 @@ static void ConvertToUTF16( const char *psz_utf8_str, uint32_t *pi_strlen, UniCh
     int           i_string_length;
 
     p_cfString = CFStringCreateWithCString( NULL, psz_utf8_str, kCFStringEncodingUTF8 );
+    if( !p_cfString )
+        return;
+
     i_string_length = CFStringGetLength( p_cfString );
 
     if( pi_strlen )




More information about the vlc-devel mailing list