Bug 227866 - [MSE] CompletionHandler may not always be called in SourceBufferPrivate::didReceiveInitializationSegment
Summary: [MSE] CompletionHandler may not always be called in SourceBufferPrivate::didR...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-07-11 21:23 PDT by Jean-Yves Avenard [:jya]
Modified: 2021-07-11 21:23 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jean-Yves Avenard [:jya] 2021-07-11 21:23:39 PDT
If the initialisation segment received in SourceBufferPrivate::didReceiveInitializationSegment is invalid; then the CompletionHandler will not be called; which would assert in the CompletionHandler destructor
void SourceBufferPrivate::didReceiveInitializationSegment(SourceBufferPrivateClient::InitializationSegment&& segment, CompletionHandler<void()>&& completionHandler)
{
    if (!m_client) {
        completionHandler();
        return;
    }

    if (m_receivedFirstInitializationSegment && !validateInitializationSegment(segment)) {
        m_client->sourceBufferPrivateAppendError(true);
        return;
    }
...
}


if validateInitializationSegment(segment) returns false; then we will error, and return. But this would assert once completionHandler goes out of scope.
Comment 1 Radar WebKit Bug Importer 2021-07-11 21:23:58 PDT
<rdar://problem/80446981>