Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3426aa20 authored by Devendra Singhi's avatar Devendra Singhi
Browse files

Added limit to number of Loop Iterations in C2Fuzzer

Test: make C2Fuzzer-defaults
Bug: 173672402

Change-Id: I964eb63845e83e4fc6c4a624e550d99c70788eb6
parent 657dd4cc
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -246,7 +246,8 @@ void Codec2Fuzzer::decodeFrames(const uint8_t* data, size_t size) {
  bufferSource->parse();
  c2_status_t status = C2_OK;
  size_t numFrames = 0;
  while (!bufferSource->isEos()) {
  int32_t iterationCount = 0;
  while (!bufferSource->isEos() && ++iterationCount <= kMaxIterations) {
    uint8_t* frame = nullptr;
    size_t frameSize = 0;
    FrameData frameData = bufferSource->getFrame();
+1 −0
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ namespace android {
#define C2FUZZER_ALIGN(_sz, _align) (((_sz) + ((_align)-1)) & ~((_align)-1))

constexpr std::chrono::milliseconds kC2FuzzerTimeOut = 5000ms;
constexpr int32_t kMaxIterations = 100;
constexpr int32_t kNumberOfC2WorkItems = 8;
constexpr uint32_t kWidthOfVideo = 3840;
constexpr uint32_t kHeightOfVideo = 2160;