Title: [241231] trunk/Source/WebCore
Revision
241231
Author
mmaxfi...@apple.com
Date
2019-02-08 20:06:34 -0800 (Fri, 08 Feb 2019)

Log Message

[Cocoa] CTLineGetGlyphRuns() might return nullptr
https://bugs.webkit.org/show_bug.cgi?id=194467
<rdar://problem/42423999>

Reviewed by Simon Fraser.

Be somewhat defensive to try to make sure this sort of thing doesn't happen in the future.

Covered by find/text/find-backwards.html

* platform/graphics/mac/ComplexTextControllerCoreText.mm:
(WebCore::ComplexTextController::collectComplexTextRunsForCharacters):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (241230 => 241231)


--- trunk/Source/WebCore/ChangeLog	2019-02-09 03:56:32 UTC (rev 241230)
+++ trunk/Source/WebCore/ChangeLog	2019-02-09 04:06:34 UTC (rev 241231)
@@ -1,5 +1,20 @@
 2019-02-08  Myles C. Maxfield  <mmaxfi...@apple.com>
 
+        [Cocoa] CTLineGetGlyphRuns() might return nullptr
+        https://bugs.webkit.org/show_bug.cgi?id=194467
+        <rdar://problem/42423999>
+
+        Reviewed by Simon Fraser.
+
+        Be somewhat defensive to try to make sure this sort of thing doesn't happen in the future.
+
+        Covered by find/text/find-backwards.html
+
+        * platform/graphics/mac/ComplexTextControllerCoreText.mm:
+        (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
+
+2019-02-08  Myles C. Maxfield  <mmaxfi...@apple.com>
+
         [Cocoa] Ask platform for generic font family mappings
         https://bugs.webkit.org/show_bug.cgi?id=187723
         <rdar://problem/41892438>

Modified: trunk/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm (241230 => 241231)


--- trunk/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm	2019-02-09 03:56:32 UTC (rev 241230)
+++ trunk/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm	2019-02-09 04:06:34 UTC (rev 241231)
@@ -162,6 +162,9 @@
         RetainPtr<CTTypesetterRef> typesetter = adoptCF(CTTypesetterCreateWithUniCharProviderAndOptions(&provideStringAndAttributes, 0, &info, m_run.ltr() ? ltrTypesetterOptions : rtlTypesetterOptions));
         IGNORE_NULL_CHECK_WARNINGS_END
 
+        if (!typesetter)
+            return;
+
         line = adoptCF(CTTypesetterCreateLine(typesetter.get(), CFRangeMake(0, 0)));
     } else {
         ProviderInfo info = { cp, length, stringAttributes.get() };
@@ -169,10 +172,16 @@
         line = adoptCF(CTLineCreateWithUniCharProvider(&provideStringAndAttributes, nullptr, &info));
     }
 
+    if (!line)
+        return;
+
     m_coreTextLines.append(line.get());
 
     CFArrayRef runArray = CTLineGetGlyphRuns(line.get());
 
+    if (!runArray)
+        return;
+
     CFIndex runCount = CFArrayGetCount(runArray);
 
     for (CFIndex r = 0; r < runCount; r++) {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to