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

Commit 10db9192 authored by Marco Nelissen's avatar Marco Nelissen
Browse files

Limit iterations when parsing mkv file

to avoid infinite loops on malformed files.

Bug: 148834096
Bug: 141860394
Test: PoCs, manual, CT
Change-Id: I80c58f2dd98fbc12e98b325cf197bdf53ff600e5
parent 55bfd11f
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -339,7 +339,12 @@ void BlockIterator::advance() {
}

void BlockIterator::advance_l() {
    for (;;) {
    for (int i = 0;; i++) {
        if (i == 1000) {
            ALOGE("no block found after %d iterations, stopping", i);
            mCluster = NULL;
            break;
        }
        long res = mCluster->GetEntry(mBlockEntryIndex, mBlockEntry);
        ALOGV("GetEntry returned %ld", res);