[webkit-changes] [WebKit/WebKit] 61b093: ObjCFrameBuffer getBuffer callback can return nullptr

youennf noreply at github.com
Mon Jul 17 06:55:44 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 61b0933a5616ba414696275ee8269e6f4851d85a
      https://github.com/WebKit/WebKit/commit/61b0933a5616ba414696275ee8269e6f4851d85a
  Author: Youenn Fablet <youennf at gmail.com>
  Date:   2023-07-17 (Mon, 17 Jul 2023)

  Changed paths:
    M Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/native/src/objc_frame_buffer.mm

  Log Message:
  -----------
  ObjCFrameBuffer getBuffer callback can return nullptr
https://bugs.webkit.org/show_bug.cgi?id=259265
rdar://112220174

Reviewed by Eric Carlson.

RemoteVideoFrameProxy::pixelBuffer() is not guaranteed to always return a non null pixel buffer.
It is trying to do so by returning a black frame if grabbing the actual video frame fails.
But the black frame creation can itself fail.

To prevent this, we are updating ObjCFrameBuffer so that, should the pixel buffer be nullptr,
ObjCFrameBuffer::ToI420 will itself returns nullptr instead ofa I420BufferInterface which is empty inside.
The rest of libwebrtc deals with nullptr I420BufferInterface by exiting encoding early.

Manually tested by updating RemoteVideoFrameProxy::pixelBuffer() to return nullptr.

* Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/native/src/objc_frame_buffer.mm:
(webrtc::ObjCFrameBuffer::ToI420):
(webrtc::ObjCFrameBuffer::wrapped_frame_buffer const):

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




More information about the webkit-changes mailing list