SWRDKV-5447: ocdm-playready defect fix.#14
Conversation
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
There was a problem hiding this comment.
Pull request overview
This PR addresses stability issues in the PlayReady CDMi integration by hardening IV handling in decrypt, adding additional bounds checks around secure-token operations, and introducing session tracking to prevent resetting/freeing the shared PlayReady app context while sessions still reference it.
Changes:
- Replaced
assert(ivLength > 0)with a runtime validation thativLengthis exactly 8 (CTR) or 16 (CBC), and clamped a Netflix-path IVmemcpy. - Added additional safety checks in the decrypt path to avoid buffer overruns (SVP token size, decrypted length vs. encrypted length).
- Introduced
m_sessionCountplus additional locking around app-context usage and lifecycle operations.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| MediaSystem.cpp | Adds session counting and additional locking to prevent app-context reset/uninit while sessions exist. |
| MediaSession.cpp | Adds runtime IV length validation, clamps IV copy, adds several mutex guards, and adds extra length checks in decrypt paths. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
MediaSystem.cpp:645
UninitializeAppCtx()returnsCDMi_S_FALSEwhenm_poAppContextis already null. Callers likeDeleteSecureStore()now treat any non-success as fatal and will return early, which can prevent secure-store deletion in the common "already uninitialized" case. Consider treating "already uninitialized" as success when there are no active sessions.
if (m_poAppContext.get() == nullptr)
{
return CDMi_S_FALSE;
}
What it does: Replaces the
assert(ivLength>0)with a runtime check thatsampleInfo->ivLengthis exactlyEXPECTED_AES_CTR_IVDATA_SIZE(8) orEXPECTED_AES_CBC_IVDATA_SIZE(16) — returningCDMi_S_FALSEotherwise — and additionally clamps the Netflix-pathmemcpytosizeof(iv_vector).