Title: [295460] trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.mm
Revision
295460
Author
[email protected]
Date
2022-06-10 13:23:56 -0700 (Fri, 10 Jun 2022)

Log Message

Safari crashes anytime any web links on a webpage are clicked on
https://bugs.webkit.org/show_bug.cgi?id=241500
rdar://94655829

Reviewed by Tim Horton.

In some VM scenarios, IOSurfaceAccelerator is not available, which
causes a crash when navigating (creating the back-forward images).
The solution is to check for null after attempting to create the
accelerator.

* Source/WebCore/platform/graphics/cocoa/IOSurface.mm:
(WebCore::IOSurface::convertToFormat): Add a null check and bail.

Canonical link: https://commits.webkit.org/251466@main

Modified Paths

Diff

Modified: trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.mm (295459 => 295460)


--- trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.mm	2022-06-10 19:01:43 UTC (rev 295459)
+++ trunk/Source/WebCore/platform/graphics/cocoa/IOSurface.mm	2022-06-10 20:23:56 UTC (rev 295460)
@@ -462,6 +462,11 @@
     if (!accelerator) {
         IOSurfaceAcceleratorCreate(nullptr, nullptr, &accelerator);
 
+        if (!accelerator) {
+            callback(nullptr);
+            return;
+        }
+
         auto runLoopSource = IOSurfaceAcceleratorGetRunLoopSource(accelerator);
         CFRunLoopAddSource(CFRunLoopGetMain(), runLoopSource, kCFRunLoopDefaultMode);
     }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to