Merge "cdm_engine_fuzzer: Bug Fix" into main

This commit is contained in:
Treehugger Robot
2023-11-09 12:08:08 +00:00
committed by Android (Google) Code Review

View File

@@ -44,6 +44,7 @@ const std::string kUsageFilePrefixL1 = "/data/vendor/mediadrm/IDM0/L1/";
const std::string kUsageFilePrefixL3 = "/data/vendor/mediadrm/IDM0/L3/";
const std::string kCertFile = kUsageFilePrefixL3 + "cert.bin";
const std::string kCertFile1 = kUsageFilePrefixL3 + "cert1.bin";
static constexpr int32_t kMaxRuns = 500;
using namespace wvutil;
using namespace wvcdm::metrics;
@@ -225,7 +226,11 @@ void CdmEngineFuzzer::process() {
CdmEngineFuzzer::init(cdmEngine);
while (mFdp.remaining_bytes()) {
int32_t runs = kMaxRuns;
/* Limited the while loop to prevent a timeout caused by the
/* CryptoSession constructor, which took time to initialize
/* OEMCrypto in each iteration.*/
while (mFdp.remaining_bytes() > 0 && --runs) {
auto invokeCdmEngineAPI = mFdp.PickValueInArray<
const std::function<void()>>({
[&]() { cdmEngine->OnTimerEvent(); },