diff --git a/libwvdrmengine/cdm/core/src/privacy_crypto_boringssl.cpp b/libwvdrmengine/cdm/core/src/privacy_crypto_boringssl.cpp index 908cb7dc..13156209 100644 --- a/libwvdrmengine/cdm/core/src/privacy_crypto_boringssl.cpp +++ b/libwvdrmengine/cdm/core/src/privacy_crypto_boringssl.cpp @@ -336,11 +336,12 @@ bool ExtractExtensionValueFromCertificate(const std::string& cert, STACK_OF(X509)* certs = pkcs7->d.sign->cert; // Find the desired certificate from the stack. - if (cert_index >= static_cast(sk_X509_num(certs))) { + const size_t num_certs = static_cast(sk_X509_num(certs)); + if (cert_index >= num_certs) { LOGE( "Unexpected number of certificates in chain: " "count = %zu, minimum = %zu", - sk_X509_num(certs), cert_index + 1); + num_certs, cert_index + 1); return false; } diff --git a/libwvdrmengine/oemcrypto/ref/src/oemcrypto_usage_table_ref.h b/libwvdrmengine/oemcrypto/ref/src/oemcrypto_usage_table_ref.h index a2d87d01..d112695b 100644 --- a/libwvdrmengine/oemcrypto/ref/src/oemcrypto_usage_table_ref.h +++ b/libwvdrmengine/oemcrypto/ref/src/oemcrypto_usage_table_ref.h @@ -9,6 +9,7 @@ #include #include +#include #include #include