From 5b169b17226017d88fe9103f7faeaca9fe494d5d Mon Sep 17 00:00:00 2001 From: Rahul Frias Date: Wed, 2 May 2018 00:12:31 -0700 Subject: [PATCH] Avoid race conditions between periodic timer and close sessions [ Merge of http://go/wvgerrit/49402 ] Bug: 78912546 Test: WV unit/integration tests, GtsMediaTestCases, Aupt tests Change-Id: Ic2016e8b557cd2dd45d5d3bbaa28be16e58dab8b --- libwvdrmengine/cdm/src/wv_content_decryption_module.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libwvdrmengine/cdm/src/wv_content_decryption_module.cpp b/libwvdrmengine/cdm/src/wv_content_decryption_module.cpp index 1e0fcce8..f7098e98 100644 --- a/libwvdrmengine/cdm/src/wv_content_decryption_module.cpp +++ b/libwvdrmengine/cdm/src/wv_content_decryption_module.cpp @@ -72,6 +72,7 @@ CdmResponseType WvContentDecryptionModule::CloseSession( CdmEngine* cdm_engine = GetCdmForSessionId(session_id); // TODO(rfrias): Avoid reusing the error codes from CdmEngine. if (!cdm_engine) return SESSION_NOT_FOUND_1; + AutoLock auto_lock(cdms_lock_); CdmResponseType sts = cdm_engine->CloseSession(session_id); cdm_engine->GetMetrics()->cdm_engine_close_session_.Increment(sts); if (sts == NO_ERROR) {