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

Commit 5ff4bb7a authored by Abhishek Arya's avatar Abhishek Arya Committed by Android Git Automerger
Browse files

am 8026ad38: am 6efa86be: Merge "Check vector size before accessing" into klp-dev

* commit '8026ad38':
  Check vector size before accessing
parents 3b77e940 8026ad38
Loading
Loading
Loading
Loading
+9 −0
Original line number Original line Diff line number Diff line
@@ -3355,8 +3355,17 @@ status_t MPEG4Source::parseSampleAuxiliaryInformationOffsets(
    int ivlength;
    int ivlength;
    CHECK(mFormat->findInt32(kKeyCryptoDefaultIVSize, &ivlength));
    CHECK(mFormat->findInt32(kKeyCryptoDefaultIVSize, &ivlength));


    // only 0, 8 and 16 byte initialization vectors are supported
    if (ivlength != 0 && ivlength != 8 && ivlength != 16) {
        ALOGW("unsupported IV length: %d", ivlength);
        return ERROR_MALFORMED;
    }
    // read CencSampleAuxiliaryDataFormats
    // read CencSampleAuxiliaryDataFormats
    for (size_t i = 0; i < mCurrentSampleInfoCount; i++) {
    for (size_t i = 0; i < mCurrentSampleInfoCount; i++) {
        if (i >= mCurrentSamples.size()) {
            ALOGW("too few samples");
            break;
        }
        Sample *smpl = &mCurrentSamples.editItemAt(i);
        Sample *smpl = &mCurrentSamples.editItemAt(i);


        memset(smpl->iv, 0, 16);
        memset(smpl->iv, 0, 16);