Bug 309534
| Summary: | CDMSessionAVContentKeySession::isAnyKeyUsable should check that content key is available | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Ruthvik Konda <rkonda2> |
| Component: | Media | Assignee: | Ruthvik Konda <rkonda2> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Ruthvik Konda
`CDMSessionAVContentKeySession::attachContentKeyToSample()` crashes with a debug ASSERT when `[contentKeyRequest() contentKey]` returns nil.
The legacy CDM session's `isAnyKeyUsable()` returns true when key IDs from the `AVContentKeyRequest` match the sample's key IDs, but does not verify that `[request contentKey]` is non-nil. This allows samples to proceed through `canEnqueueSample()` and reach `attachContentKeyToSample()` before AVFoundation has finished deriving the content key (via `processContentKeyResponse:`).
The modern code path (`CDMInstanceSessionFairPlayStreamingAVFObjC::attachContentKeyToSample`) already handles nil `contentKey` gracefully via an early return.
Stack trace:
0 com.apple.WebCore: WTFCrashWithInfo
1 com.apple.WebCore: CDMSessionAVContentKeySession::attachContentKeyToSample
2 com.apple.WebCore: AudioVideoRendererAVFObjC::attachContentKeyToSampleIfNeeded
3 com.apple.WebCore: AudioVideoRendererAVFObjC::enqueueSample
4 com.apple.WebKit: RemoteAudioVideoRendererProxyManager::enqueueSample
[...]
<rdar://171478431>
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Ruthvik Konda
Pull request: https://github.com/WebKit/WebKit/pull/60234
EWS
Committed 309033@main (ec2a9eedd035): <https://commits.webkit.org/309033@main>
Reviewed commits have been landed. Closing PR #60234 and removing active labels.