Merge "cdm_engine_fuzzer: Bug Fix" into main
This commit is contained in:
committed by
Android (Google) Code Review
commit
df00f99671
@@ -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 kUsageFilePrefixL3 = "/data/vendor/mediadrm/IDM0/L3/";
|
||||||
const std::string kCertFile = kUsageFilePrefixL3 + "cert.bin";
|
const std::string kCertFile = kUsageFilePrefixL3 + "cert.bin";
|
||||||
const std::string kCertFile1 = kUsageFilePrefixL3 + "cert1.bin";
|
const std::string kCertFile1 = kUsageFilePrefixL3 + "cert1.bin";
|
||||||
|
static constexpr int32_t kMaxRuns = 500;
|
||||||
|
|
||||||
using namespace wvutil;
|
using namespace wvutil;
|
||||||
using namespace wvcdm::metrics;
|
using namespace wvcdm::metrics;
|
||||||
@@ -225,7 +226,11 @@ void CdmEngineFuzzer::process() {
|
|||||||
|
|
||||||
CdmEngineFuzzer::init(cdmEngine);
|
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<
|
auto invokeCdmEngineAPI = mFdp.PickValueInArray<
|
||||||
const std::function<void()>>({
|
const std::function<void()>>({
|
||||||
[&]() { cdmEngine->OnTimerEvent(); },
|
[&]() { cdmEngine->OnTimerEvent(); },
|
||||||
|
|||||||
Reference in New Issue
Block a user