Title: [188277] branches/safari-601.1.46-branch
- Revision
- 188277
- Author
- [email protected]
- Date
- 2015-08-11 12:47:04 -0700 (Tue, 11 Aug 2015)
Log Message
Merge r188195. rdar://problem/22102378
Modified Paths
Added Paths
Diff
Modified: branches/safari-601.1.46-branch/LayoutTests/ChangeLog (188276 => 188277)
--- branches/safari-601.1.46-branch/LayoutTests/ChangeLog 2015-08-11 19:47:00 UTC (rev 188276)
+++ branches/safari-601.1.46-branch/LayoutTests/ChangeLog 2015-08-11 19:47:04 UTC (rev 188277)
@@ -1,5 +1,20 @@
2015-08-11 Matthew Hanson <[email protected]>
+ Merge r188195. rdar://problem/22102378
+
+ 2015-08-09 Myles C. Maxfield <[email protected]>
+
+ Crash in ComplexTextController when laying out obscure text
+ https://bugs.webkit.org/show_bug.cgi?id=147806
+ <rdar://problem/22102378>
+
+ Reviewed by Darin Adler.
+
+ * fast/text/crash-obscure-text-expected.txt: Added.
+ * fast/text/crash-obscure-text.html: Added.
+
+2015-08-11 Matthew Hanson <[email protected]>
+
Merge r188263. rdar://problem/22202935
2015-08-11 Myles C. Maxfield <[email protected]>
Added: branches/safari-601.1.46-branch/LayoutTests/fast/text/crash-obscure-text-expected.txt (0 => 188277)
--- branches/safari-601.1.46-branch/LayoutTests/fast/text/crash-obscure-text-expected.txt (rev 0)
+++ branches/safari-601.1.46-branch/LayoutTests/fast/text/crash-obscure-text-expected.txt 2015-08-11 19:47:04 UTC (rev 188277)
@@ -0,0 +1,3 @@
+This test makes sure we don't crash when encountering some particularly exotic codepoints. The test passes if we do not crash.
+
+ܘ̈
Added: branches/safari-601.1.46-branch/LayoutTests/fast/text/crash-obscure-text.html (0 => 188277)
--- branches/safari-601.1.46-branch/LayoutTests/fast/text/crash-obscure-text.html (rev 0)
+++ branches/safari-601.1.46-branch/LayoutTests/fast/text/crash-obscure-text.html 2015-08-11 19:47:04 UTC (rev 188277)
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script>
+if (window.testRunner)
+ testRunner.dumpAsText();
+</script>
+<p>This test makes sure we don't crash when encountering some particularly exotic codepoints. The test passes if we do not crash.</p>
+ܘ̈
+</body>
+</html>
Modified: branches/safari-601.1.46-branch/Source/WebCore/ChangeLog (188276 => 188277)
--- branches/safari-601.1.46-branch/Source/WebCore/ChangeLog 2015-08-11 19:47:00 UTC (rev 188276)
+++ branches/safari-601.1.46-branch/Source/WebCore/ChangeLog 2015-08-11 19:47:04 UTC (rev 188277)
@@ -1,5 +1,25 @@
2015-08-11 Matthew Hanson <[email protected]>
+ Merge r188195. rdar://problem/22102378
+
+ 2015-08-09 Myles C. Maxfield <[email protected]>
+
+ Crash in ComplexTextController when laying out obscure text
+ https://bugs.webkit.org/show_bug.cgi?id=147806
+ <rdar://problem/22102378>
+
+ Reviewed by Darin Adler.
+
+ CTFontDescriptorCopyAttribute(fontDescriptor.get(), kCTFontReferenceURLAttribute) can return nullptr.
+
+ Test: fast/text/crash-obscure-text.html
+
+ * platform/graphics/mac/ComplexTextControllerCoreText.mm:
+ (WebCore::safeCFEqual):
+ (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
+
+2015-08-11 Matthew Hanson <[email protected]>
+
Merge r188263. rdar://problem/22202935
2015-08-11 Myles C. Maxfield <[email protected]>
Modified: branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm (188276 => 188277)
--- branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm 2015-08-11 19:47:00 UTC (rev 188276)
+++ branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm 2015-08-11 19:47:04 UTC (rev 188277)
@@ -189,6 +189,11 @@
return info->cp + stringIndex;
}
+static inline bool safeCFEqual(CFTypeRef a, CFTypeRef b)
+{
+ return (!a && !b) || (a && b && CFEqual(a, b));
+}
+
void ComplexTextController::collectComplexTextRunsForCharacters(const UChar* cp, unsigned length, unsigned stringLocation, const Font* font)
{
if (!font) {
@@ -259,14 +264,14 @@
CTFontRef runCTFont = static_cast<CTFontRef>(CFDictionaryGetValue(runAttributes, kCTFontAttributeName));
ASSERT(CFGetTypeID(runCTFont) == CTFontGetTypeID());
RetainPtr<CFTypeRef> runFontEqualityObject = FontPlatformData::objectForEqualityCheck(runCTFont);
- if (!CFEqual(runFontEqualityObject.get(), font->platformData().objectForEqualityCheck().get())) {
+ if (!safeCFEqual(runFontEqualityObject.get(), font->platformData().objectForEqualityCheck().get())) {
// Begin trying to see if runFont matches any of the fonts in the fallback list.
for (unsigned i = 0; !m_font.fallbackRangesAt(i).isNull(); ++i) {
runFont = m_font.fallbackRangesAt(i).fontForCharacter(baseCharacter);
if (!runFont)
continue;
- if (CFEqual(runFont->platformData().objectForEqualityCheck().get(), runFontEqualityObject.get()))
+ if (safeCFEqual(runFont->platformData().objectForEqualityCheck().get(), runFontEqualityObject.get()))
break;
runFont = nullptr;
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes