diff --git a/libwvdrmengine/cdm/core/src/crypto_session.cpp b/libwvdrmengine/cdm/core/src/crypto_session.cpp index 61321942..1ff794ee 100644 --- a/libwvdrmengine/cdm/core/src/crypto_session.cpp +++ b/libwvdrmengine/cdm/core/src/crypto_session.cpp @@ -374,15 +374,18 @@ void CryptoSession::Init() { void CryptoSession::ReinitializeForTest() { if (initialized_) { - initialized_ = false; - OEMCryptoResult status = OEMCrypto_Terminate(); + const OEMCryptoResult status = OEMCrypto_Terminate(); if (OEMCrypto_SUCCESS != status) { LOGE("OEMCrypto_Terminate failed: %d", status); return; } + initialized_ = false; + // 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. - OEMCryptoResult status = OEMCrypto_Initialize(); + const OEMCryptoResult status = OEMCrypto_Initialize(); if (OEMCrypto_SUCCESS != status) { LOGE("OEMCrypto_Initialize failed: %d", status); return;