Title: [278312] trunk/Source/WebCore
Revision
278312
Author
[email protected]
Date
2021-06-01 10:19:04 -0700 (Tue, 01 Jun 2021)

Log Message

[WebXR] Attach IOSurface to WebXROpaqueFramebuffer
https://bugs.webkit.org/show_bug.cgi?id=225896
<rdar://problem/78128289>

Add a null check to fix a test crash.

* Modules/webxr/WebXROpaqueFramebuffer.cpp:
(WebCore::WebXROpaqueFramebuffer::startFrame):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (278311 => 278312)


--- trunk/Source/WebCore/ChangeLog	2021-06-01 16:49:09 UTC (rev 278311)
+++ trunk/Source/WebCore/ChangeLog	2021-06-01 17:19:04 UTC (rev 278312)
@@ -1,3 +1,14 @@
+2021-06-01  Dean Jackson  <[email protected]>
+
+        [WebXR] Attach IOSurface to WebXROpaqueFramebuffer
+        https://bugs.webkit.org/show_bug.cgi?id=225896
+        <rdar://problem/78128289>
+
+        Add a null check to fix a test crash.
+
+        * Modules/webxr/WebXROpaqueFramebuffer.cpp:
+        (WebCore::WebXROpaqueFramebuffer::startFrame):
+
 2021-06-01  Sam Weinig  <[email protected]>
 
         Factor out token-type dependent CSS property parsing functions to allow more code sharing

Modified: trunk/Source/WebCore/Modules/webxr/WebXROpaqueFramebuffer.cpp (278311 => 278312)


--- trunk/Source/WebCore/Modules/webxr/WebXROpaqueFramebuffer.cpp	2021-06-01 16:49:09 UTC (rev 278311)
+++ trunk/Source/WebCore/Modules/webxr/WebXROpaqueFramebuffer.cpp	2021-06-01 17:19:04 UTC (rev 278312)
@@ -116,10 +116,15 @@
     // the textures/renderbuffers.
 
 #if USE(IOSURFACE_FOR_XR_LAYER_DATA)
+    if (!data.surface)
+        return;
+
     auto gCGL = static_cast<GraphicsContextGLOpenGL*>(m_context.graphicsContextGL());
     GCGLenum textureTarget = GraphicsContextGLOpenGL::drawingBufferTextureTarget();
 
     auto size = data.surface->size();
+    if (!size.width() || !size.height())
+        return;
 
     if (!m_opaqueTexture)
         m_opaqueTexture = gCGL->createTexture();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to