Skip to content
Permalink
Browse files
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
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295460 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
grorg committed Jun 10, 2022
1 parent b0668c9 commit 06b02857bd52d8fd9f1157cc899ef6a160596fcc
Showing 1 changed file with 5 additions and 0 deletions.
@@ -462,6 +462,11 @@ static IntSize computeMaximumSurfaceSize()
if (!accelerator) {
IOSurfaceAcceleratorCreate(nullptr, nullptr, &accelerator);

if (!accelerator) {
callback(nullptr);
return;
}

auto runLoopSource = IOSurfaceAcceleratorGetRunLoopSource(accelerator);
CFRunLoopAddSource(CFRunLoopGetMain(), runLoopSource, kCFRunLoopDefaultMode);
}

0 comments on commit 06b0285

Please sign in to comment.