2008-11-25 Pierre-Olivier Latour <pol@apple.com>
authorpol@apple.com <pol@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 26 Nov 2008 00:54:24 +0000 (00:54 +0000)
committerpol@apple.com <pol@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 26 Nov 2008 00:54:24 +0000 (00:54 +0000)
        Reviewed by Mark Rowe.

        createFontCustomPlatformData() crashes if CGFontCreateWithPlatformFont() returns NULL

        https://bugs.webkit.org/show_bug.cgi?id=22503

        * platform/graphics/mac/FontCustomPlatformData.cpp:
        (WebCore::createFontCustomPlatformData):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@38770 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/platform/graphics/mac/FontCustomPlatformData.cpp

index bb37efab46cf7c56ba97a79f84b877b2bee0f75d..33231c90443343b3cc7e4b19fd617943205427cc 100644 (file)
@@ -1,3 +1,14 @@
+2008-11-25  Pierre-Olivier Latour  <pol@apple.com>
+
+        Reviewed by Mark Rowe.
+
+        createFontCustomPlatformData() crashes if CGFontCreateWithPlatformFont() returns NULL
+
+        https://bugs.webkit.org/show_bug.cgi?id=22503
+
+        * platform/graphics/mac/FontCustomPlatformData.cpp:
+        (WebCore::createFontCustomPlatformData):
+
 2008-11-25  Julien Chaffraix  <jchaffraix@webkit.org>
 
         Reviewed by Eric Seidel.
index 1fb144c8a12ea17d87af12128cc9a347218ca1f3..9aa4997ac29177d00b9c29c0d41f15de2453ccb0 100644 (file)
@@ -68,7 +68,7 @@ FontCustomPlatformData* createFontCustomPlatformData(SharedBuffer* buffer)
     CGFontRef cgFontRef = CGFontCreateWithPlatformFont(&fontRef);
 #ifndef BUILDING_ON_TIGER
     // Workaround for <rdar://problem/5675504>.
-    if (!CGFontGetNumberOfGlyphs(cgFontRef)) {
+    if (cgFontRef && !CGFontGetNumberOfGlyphs(cgFontRef)) {
         CFRelease(cgFontRef);
         cgFontRef = 0;
     }