Skip to content

Commit

Permalink
[Mac wk1] http/tests/media/fairplay/fps-mse-play-while-not-in-dom.htm…
Browse files Browse the repository at this point in the history
…l is a consistent crash

https://bugs.webkit.org/show_bug.cgi?id=271910
rdar://125380872

Reviewed by Eric Carlson.

In WebKitLegacy, an error can synchronously fire during enqueueSampleBuffer(), which can cause
the HTMLMediaElement to move to an error state, and its MediaSource will subsequently become
disconnected and close. This causes `m_videoRenderer` to become null after a null check.

This should likely be addressed by enqueueing the error to be executed during the next run loop.
Short term, however, is to detect that `m_videoRenderer` has become null and return early.

* Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::enqueueSampleBuffer):

Canonical link: https://commits.webkit.org/276848@main
  • Loading branch information
jernoble committed Mar 30, 2024
1 parent dfe516c commit 55febbb
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1092,6 +1092,10 @@ static inline bool shouldAddContentKeyRecipients()
WebSampleBufferVideoRendering *renderer = nil;
if (m_videoRenderer) {
m_videoRenderer->enqueueSample(sample.platformSample().sample.cmSampleBuffer, !sample.isNonDisplaying());

// Enqueuing a sample for display my synchronously fire an error, which can cause m_videoRenderer to become null.
if (!m_videoRenderer)
return;
renderer = m_videoRenderer->renderer();
#if HAVE(AVSAMPLEBUFFERDISPLAYLAYER_READYFORDISPLAY)
if (AVSampleBufferDisplayLayer *displayLayer = m_videoRenderer->displayLayer()) {
Expand Down

0 comments on commit 55febbb

Please sign in to comment.