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

Commit 236af7da 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 am: ce01b72e

parents 91a14d4f ce01b72e
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) {