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

Commit d939797b authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Fix propagating CryptoInfos during decryption error" into main am: 2e264b11 am: 2e65823e

parents 7a3fe90a 2e65823e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -651,7 +651,7 @@ status_t CCodecBufferChannel::attachEncryptedBuffers(
            return -ENOSYS;
        }
        // we are dealing with just one cryptoInfo or descrambler.
        std::unique_ptr<CodecCryptoInfo> info = std::move(cryptoInfos->value[0]);
        std::unique_ptr<CodecCryptoInfo> &info = cryptoInfos->value[0];
        if (info == nullptr) {
            ALOGE("Cannot decrypt, CryptoInfos are null.");
            return -ENOSYS;
@@ -700,7 +700,7 @@ status_t CCodecBufferChannel::attachEncryptedBuffers(
            mDecryptDestination, mHeapSeqNum, &dst.nonsecureMemory);
    for (int i = 0; i < bufferInfos->value.size(); i++) {
        if (bufferInfos->value[i].mSize > 0) {
            std::unique_ptr<CodecCryptoInfo> info = std::move(cryptoInfos->value[cryptoInfoIdx++]);
            std::unique_ptr<CodecCryptoInfo> &info = cryptoInfos->value[cryptoInfoIdx++];
            src.offset = srcOffset;
            src.size = bufferInfos->value[i].mSize;
            result = mCrypto->decrypt(
+3 −0
Original line number Diff line number Diff line
@@ -132,6 +132,9 @@ status_t CryptoAsync::decryptAndQueue(sp<AMessage> & msg) {
    }
    if (err != OK) {
        std::list<sp<AMessage>> errorList;
        if (buffer->meta()->findObject("cryptoInfos", &obj)) {
            msg->setObject("cryptoInfos", obj);
        }
        msg->removeEntryByName("buffer");
        msg->setInt32("err", err);
        msg->setInt32("actionCode", ACTION_CODE_FATAL);
+5 −1
Original line number Diff line number Diff line
@@ -6630,7 +6630,11 @@ status_t MediaCodec::onQueueInputBuffer(const sp<AMessage> &msg) {
                    && (mFlags & kFlagUseCryptoAsync)) {
                // create error detail
                sp<AMessage> cryptoErrorInfo = new AMessage();
                if (msg->findObject("cryptoInfos", &obj)) {
                    cryptoErrorInfo->setObject("cryptoInfos", obj);
                } else {
                    buildCryptoInfoAMessage(cryptoErrorInfo, CryptoAsync::kActionDecrypt);
                }
                cryptoErrorInfo->setInt32("err", err);
                cryptoErrorInfo->setInt32("actionCode", ACTION_CODE_FATAL);
                cryptoErrorInfo->setString("errorDetail", errorDetailMsg);