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

Commit db45c5f9 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Fix use-after-free in AMediaExtractor_getSampleCryptoInfo" into tm-dev...

Merge "Fix use-after-free in AMediaExtractor_getSampleCryptoInfo" into tm-dev am: ce01b72e am: 5562c267

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/av/+/17826307



Change-Id: If962488ae19ae48d74a5c23fd0c147ae1a471c47
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents c4bfaebd 5562c267
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -388,9 +388,11 @@ AMediaCodecCryptoInfo *AMediaExtractor_getSampleCryptoInfo(AMediaExtractor *ex)
        mode = CryptoPlugin::kMode_AES_CTR;
    }

    sp<ABuffer> clearbuf;
    sp<ABuffer> cryptedbuf;
    if (sizeof(uint32_t) != sizeof(size_t)) {
        sp<ABuffer> clearbuf   = U32ArrayToSizeBuf(numSubSamples, (uint32_t *)cleardata);
        sp<ABuffer> cryptedbuf = U32ArrayToSizeBuf(numSubSamples, (uint32_t *)crypteddata);
        clearbuf   = U32ArrayToSizeBuf(numSubSamples, (uint32_t *)cleardata);
        cryptedbuf = U32ArrayToSizeBuf(numSubSamples, (uint32_t *)crypteddata);
        cleardata   = clearbuf    == NULL ? NULL : clearbuf->data();
        crypteddata = crypteddata == NULL ? NULL : cryptedbuf->data();
        if(crypteddata == NULL || cleardata == NULL) {