Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: e3d6e0875a7a26b3fe200084914de415ce5dc1c7
      
https://github.com/WebKit/WebKit/commit/e3d6e0875a7a26b3fe200084914de415ce5dc1c7
  Author: Mike Wyrzykowski <[email protected]>
  Date:   2025-03-04 (Tue, 04 Mar 2025)

  Changed paths:
    M Source/WebCore/Modules/webxr/WebXROpaqueFramebuffer.cpp
    M Source/WebCore/Modules/webxr/WebXROpaqueFramebuffer.h
    M Source/WebCore/Modules/webxr/WebXROpaqueFramebufferCocoa.cpp
    M Source/WebCore/html/canvas/WebGLUtilities.h

  Log Message:
  -----------
  Use smart pointers in WebXROpaqueFramebuffer
https://bugs.webkit.org/show_bug.cgi?id=285629
rdar://122475331

Reviewed by Dan Glastonbury.

WebXROpaqueFramebuffer stored a C++ reference to the WebGL context,
but it is not clear who ensures the GL context is retained during
the lifetime of the WebXROpaqueFramebuffer.

Via code inspection, the out of bounds access should only occur
if the reference was invalid or, more likely, 
WebGLRenderingContextBase::initializeContextState()
was never called, in which case the store / resolve should be a nop.

* Source/WebCore/Modules/webxr/WebXROpaqueFramebuffer.cpp:
(WebCore::WebXROpaqueFramebuffer::WebXROpaqueFramebuffer):
(WebCore::WebXROpaqueFramebuffer::~WebXROpaqueFramebuffer):
(WebCore::WebXROpaqueFramebuffer::startFrame):
(WebCore::WebXROpaqueFramebuffer::endFrame):
Bail if the WeakPtr is null.

* Source/WebCore/Modules/webxr/WebXROpaqueFramebuffer.h:
Store a WeakPtr instead of a &.

* Source/WebCore/html/canvas/WebGLUtilities.h:
(WebCore::ScopedWebGLRestoreTexture::~ScopedWebGLRestoreTexture):
Ensure we don't access out of bounds in the texture units.

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to