Title: [292737] trunk/Source/WebKit
Revision
292737
Author
simon.fra...@apple.com
Date
2022-04-11 16:39:27 -0700 (Mon, 11 Apr 2022)

Log Message

Crash under ShareableBitmap::makeCGImageCopy()
https://bugs.webkit.org/show_bug.cgi?id=239085
<rdar://91073153>

Reviewed by Wenson Hsieh.

ShareableBitmap::create() can return null, so check it before calling makeCGImageCopy()
on the result.

* Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::applyBackingStoreToLayer):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (292736 => 292737)


--- trunk/Source/WebKit/ChangeLog	2022-04-11 23:31:43 UTC (rev 292736)
+++ trunk/Source/WebKit/ChangeLog	2022-04-11 23:39:27 UTC (rev 292737)
@@ -1,3 +1,17 @@
+2022-04-11  Simon Fraser  <simon.fra...@apple.com>
+
+        Crash under ShareableBitmap::makeCGImageCopy()
+        https://bugs.webkit.org/show_bug.cgi?id=239085
+        <rdar://91073153>
+
+        Reviewed by Wenson Hsieh.
+
+        ShareableBitmap::create() can return null, so check it before calling makeCGImageCopy()
+        on the result.
+
+        * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
+        (WebKit::RemoteLayerBackingStore::applyBackingStoreToLayer):
+
 2022-04-11  Aditya Keerthi  <akeer...@apple.com>
 
         [iOS] Ignore find interaction deprecation warnings

Modified: trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.mm (292736 => 292737)


--- trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.mm	2022-04-11 23:31:43 UTC (rev 292736)
+++ trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.mm	2022-04-11 23:39:27 UTC (rev 292737)
@@ -572,7 +572,8 @@
     WTF::switchOn(*m_bufferHandle,
         [&] (ShareableBitmap::Handle& handle) {
             ASSERT(m_type == Type::Bitmap);
-            contents = bridge_id_cast(ShareableBitmap::create(handle)->makeCGImageCopy());
+            if (auto bitmap = ShareableBitmap::create(handle))
+                contents = bridge_id_cast(bitmap->makeCGImageCopy());
         },
         [&] (MachSendRight& machSendRight) {
             ASSERT(m_type == Type::IOSurface);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to