Bug 37747
| Summary: | Crash in FontFallbackList::determinePitch | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | 张晓明 <zhangxm> |
| Component: | Layout and Rendering | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED FIXED | ||
| Severity: | Critical | CC: | mitz, sfalken |
| Priority: | P2 | ||
| Version: | 528+ (Nightly build) | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
张晓明
On Windows 7 Platform,Get Nightly build r57720,
Build and run WinLanucher.exe, it will crash every time。
debugging it in Visual Studio 20005, find that the problem is caused by this function
void FontFallbackList::determinePitch(const Font* font) const
{
const FontData* fontData = primaryFontData(font);
if (!fontData->isSegmented())
m_pitch = static_cast<const SimpleFontData*>(fontData)->pitch();
else {
const SegmentedFontData* segmentedFontData = static_cast<const SegmentedFontData*>(fontData);
unsigned numRanges = segmentedFontData->numRanges();
if (numRanges == 1)
m_pitch = segmentedFontData->rangeAt(0).fontData()->pitch();
else
m_pitch = VariablePitch;
}
}
fontData is NULL every time。
I Step into primaryFontData() and find the real reason is the following funciont
void FontPlatformData::platformDataInit(HFONT font, float size, HDC hdc, WCHAR* faceName)
{
LOGFONT logfont;
GetObject(font, sizeof(logfont), &logfont);
m_cgFont.adoptCF(CGFontCreateWithPlatformFont(&logfont));
}
this function is in webkit\webcore\platform\graphics\win\FontPlatformDataCGWin.cpp,
this function is modified at revision 55975。before this revison, this crash not occured。
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
mitz
Thanks for the bug report! Do you have Safari 4.0.5 installed? <http://trac.webkit.org/changeset/55975> made it so that WebKit requires the version of Core Graphics that comes with Safari 4.0.5.
张晓明
Get a new version of CoreGraphics.dll from safari 4.0.5, the problem is resolved。thanks for the comments from mitz@webkit.org!:)