Bug 22503 - createFontCustomPlatformData() crashes if CGFontCreateWithPlatformFont() returns NULL
Summary: createFontCustomPlatformData() crashes if CGFontCreateWithPlatformFont() retu...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2008-11-25 16:29 PST by Pierre-Olivier Latour
Modified: 2008-11-25 16:54 PST (History)
0 users

See Also:


Attachments
Patch v1 (1.27 KB, patch)
2008-11-25 16:40 PST, Pierre-Olivier Latour
mrowe: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pierre-Olivier Latour 2008-11-25 16:29:57 PST
createFontCustomPlatformData() crashes if CGFontCreateWithPlatformFont() returns NULL:

    CGFontRef cgFontRef = CGFontCreateWithPlatformFont(&fontRef);
#ifndef BUILDING_ON_TIGER
    // Workaround for <rdar://problem/5675504>.
    if (!CGFontGetNumberOfGlyphs(cgFontRef)) {
        CFRelease(cgFontRef); <----- CRASH
        cgFontRef = 0;
    }
#endif

Original problem is here:
<rdar://problem/6401604> 10A222 + r38744: WebCore crashes in demo that uses custom font
Comment 1 Pierre-Olivier Latour 2008-11-25 16:40:16 PST
Created attachment 25511 [details]
Patch v1
Comment 2 Mark Rowe (bdash) 2008-11-25 16:43:46 PST
Comment on attachment 25511 [details]
Patch v1

r=me
Comment 3 Pierre-Olivier Latour 2008-11-25 16:54:37 PST
Sending        WebCore/ChangeLog
Sending        WebCore/platform/graphics/mac/FontCustomPlatformData.cpp
Transmitting file data ..
Committed revision 38770.