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

Commit db3eda42 authored by Lajos Molnar's avatar Lajos Molnar Committed by Android Git Automerger
Browse files

am 6a8995e0: Merge "Check buffer size before using it" into mnc-dev

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

    if ((!mIsAVC && !mIsHEVC) || mWantsNALFragments) {
@@ -4294,6 +4298,10 @@ status_t MPEG4Source::fragmentedRead(
            ALOGV("acquire_buffer returned %d", 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];