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

Commit 6f0b1b3e authored by Jon Larimer's avatar Jon Larimer Committed by Android Git Automerger
Browse files

am 484ebc81: am a1e462e5: am 0afecdeb: am aa1cc741: Merge "Check buffer size...

am 484ebc81: am a1e462e5: am 0afecdeb: am aa1cc741: Merge "Check buffer size before using it" into klp-dev

* commit '484ebc81':
  Check buffer size before using it
parents 8a83ce9c 484ebc81
Loading
Loading
Loading
Loading
+8 −0
Original line number Original line Diff line number Diff line
@@ -3814,6 +3814,10 @@ status_t MPEG4Source::read(
            CHECK(mBuffer == NULL);
            CHECK(mBuffer == NULL);
            return err;
            return err;
        }
        }
        if (size > mBuffer->size()) {
            ALOGE("buffer too small: %zu > %zu", size, mBuffer->size());
            return ERROR_BUFFER_TOO_SMALL;
        }
    }
    }


    if ((!mIsAVC && !mIsHEVC) || mWantsNALFragments) {
    if ((!mIsAVC && !mIsHEVC) || mWantsNALFragments) {
@@ -4074,6 +4078,10 @@ status_t MPEG4Source::fragmentedRead(
            ALOGV("acquire_buffer returned %d", err);
            ALOGV("acquire_buffer returned %d", err);
            return err;
            return err;
        }
        }
        if (size > mBuffer->size()) {
            ALOGE("buffer too small: %zu > %zu", size, mBuffer->size());
            return ERROR_BUFFER_TOO_SMALL;
        }
    }
    }


    const Sample *smpl = &mCurrentSamples[mCurrentSampleIndex];
    const Sample *smpl = &mCurrentSamples[mCurrentSampleIndex];