Title: [280727] trunk/Source/WebCore
Revision
280727
Author
[email protected]
Date
2021-08-06 09:52:46 -0700 (Fri, 06 Aug 2021)

Log Message

Crash at WebKit::WebPage::requestTextRecognition caused by accessibility invocation.
https://bugs.webkit.org/show_bug.cgi?id=228864
rdar://80679512

Reviewed by Chris Fleizach.

* accessibility/AXImage.cpp:
(WebCore::AXImage::imageOverlayElements):
It was calling requestTextRecognition with *element(), but element() can
return nullptr, which would lead to the crash.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (280726 => 280727)


--- trunk/Source/WebCore/ChangeLog	2021-08-06 16:38:28 UTC (rev 280726)
+++ trunk/Source/WebCore/ChangeLog	2021-08-06 16:52:46 UTC (rev 280727)
@@ -1,3 +1,16 @@
+2021-08-06  Andres Gonzalez  <[email protected]>
+
+        Crash at WebKit::WebPage::requestTextRecognition caused by accessibility invocation.
+        https://bugs.webkit.org/show_bug.cgi?id=228864
+        rdar://80679512
+
+        Reviewed by Chris Fleizach.
+
+        * accessibility/AXImage.cpp:
+        (WebCore::AXImage::imageOverlayElements):
+        It was calling requestTextRecognition with *element(), but element() can
+        return nullptr, which would lead to the crash.
+
 2021-08-06  Jer Noble  <[email protected]>
 
         [Cocoa] Remove support for AVAssetImageGenerator

Modified: trunk/Source/WebCore/accessibility/AXImage.cpp (280726 => 280727)


--- trunk/Source/WebCore/accessibility/AXImage.cpp	2021-08-06 16:38:28 UTC (rev 280726)
+++ trunk/Source/WebCore/accessibility/AXImage.cpp	2021-08-06 16:52:46 UTC (rev 280727)
@@ -67,7 +67,11 @@
     if (!page)
         return std::nullopt;
 
-    page->chrome().client().requestTextRecognition(*element(), [] (RefPtr<Element>&& imageOverlayHost) {
+    auto* element = this->element();
+    if (!element)
+        return std::nullopt;
+
+    page->chrome().client().requestTextRecognition(*element, [] (RefPtr<Element>&& imageOverlayHost) {
         if (!imageOverlayHost)
             return;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to