Title: [188274] branches/safari-601.1-branch

Diff

Modified: branches/safari-601.1-branch/LayoutTests/ChangeLog (188273 => 188274)


--- branches/safari-601.1-branch/LayoutTests/ChangeLog	2015-08-11 19:32:57 UTC (rev 188273)
+++ branches/safari-601.1-branch/LayoutTests/ChangeLog	2015-08-11 19:36:45 UTC (rev 188274)
@@ -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-branch/LayoutTests/fast/text/crash-obscure-text-expected.txt (0 => 188274)


--- branches/safari-601.1-branch/LayoutTests/fast/text/crash-obscure-text-expected.txt	                        (rev 0)
+++ branches/safari-601.1-branch/LayoutTests/fast/text/crash-obscure-text-expected.txt	2015-08-11 19:36:45 UTC (rev 188274)
@@ -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-branch/LayoutTests/fast/text/crash-obscure-text.html (0 => 188274)


--- branches/safari-601.1-branch/LayoutTests/fast/text/crash-obscure-text.html	                        (rev 0)
+++ branches/safari-601.1-branch/LayoutTests/fast/text/crash-obscure-text.html	2015-08-11 19:36:45 UTC (rev 188274)
@@ -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>
+&#x0718;&#x0308;
+</body>
+</html>

Modified: branches/safari-601.1-branch/Source/WebCore/ChangeLog (188273 => 188274)


--- branches/safari-601.1-branch/Source/WebCore/ChangeLog	2015-08-11 19:32:57 UTC (rev 188273)
+++ branches/safari-601.1-branch/Source/WebCore/ChangeLog	2015-08-11 19:36:45 UTC (rev 188274)
@@ -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-branch/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm (188273 => 188274)


--- branches/safari-601.1-branch/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm	2015-08-11 19:32:57 UTC (rev 188273)
+++ branches/safari-601.1-branch/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm	2015-08-11 19:36:45 UTC (rev 188274)
@@ -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

Reply via email to