diff --git a/libwvdrmengine/cdm/core/src/crypto_session.cpp b/libwvdrmengine/cdm/core/src/crypto_session.cpp index 40229cb3..db53e6b2 100644 --- a/libwvdrmengine/cdm/core/src/crypto_session.cpp +++ b/libwvdrmengine/cdm/core/src/crypto_session.cpp @@ -360,11 +360,22 @@ void CryptoSession::Init() { void CryptoSession::ReinitializeForTest() { if (initialized_) { + const OEMCryptoResult status = OEMCrypto_Terminate(); + if (OEMCrypto_SUCCESS != status) { + LOGE("OEMCrypto_Terminate failed: %d", status); + return; + } initialized_ = false; - if (OEMCrypto_SUCCESS != OEMCrypto_Terminate()) return; + // Tables will be reinitialized by tests when needed. + usage_table_header_l1_.reset(); + usage_table_header_l3_.reset(); } // Give up if we cannot initialize at all. - if (OEMCrypto_SUCCESS != OEMCrypto_Initialize()) return; + const OEMCryptoResult status = OEMCrypto_Initialize(); + if (OEMCrypto_SUCCESS != status) { + LOGE("OEMCrypto_Initialize failed: %d", status); + return; + } initialized_ = true; // For integration and unit tests we will install a test keybox and do not // need to do keybox provisioning.