Prevent segfaults when a session is deallocated
[ Merge of http://go/wvgerrit/26201 ] Race conditions arose when a session was closed while data was still queued for decryption in MediaCodec buffers. If a session is closed while data is still queued for decryption, subsequent decryption requests will be rejected with a CryptoException ERROR_SESSION_NOT_OPENED. Test: Verified by wv unit/integration test and WvCdmExtendedDurationTest.DecryptionCloseSessionConcurrencyTest b/36747801 Change-Id: I044d1d6b9fc886a1c353d20b9c6365319aa71e80
This commit is contained in:
@@ -1286,6 +1286,7 @@ CdmResponseType CdmEngine::Decrypt(const CdmSessionId& session_id,
|
||||
// else we must be level 1 direct and we don't need to return a buffer.
|
||||
}
|
||||
|
||||
AutoLock lock(session_list_lock_);
|
||||
CdmSessionMap::iterator session_iter = sessions_.end();
|
||||
if (session_id.empty()) {
|
||||
// Loop through the sessions to find the session containing the key_id
|
||||
|
||||
Reference in New Issue
Block a user