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

Commit 3c2c5556 authored by Wonsik Kim's avatar Wonsik Kim
Browse files

stagefright: properly handle crypto object reset

Bug: 36449774
Test: Run PoC in the bug
Test: adb shell am instrument -e size small -w 'android.media.cts/android.support.test.runner.AndroidJUnitRunner'
Test: Play an encrypted content on Play Movies
Change-Id: Ia7b38ed586460ad51fa66a6959211a7dfffa3493
parent c2504563
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -75,6 +75,9 @@ ACodecBufferChannel::ACodecBufferChannel(
}

status_t ACodecBufferChannel::queueInputBuffer(const sp<MediaCodecBuffer> &buffer) {
    if (mDealer != nullptr) {
        return -ENOSYS;
    }
    std::shared_ptr<const std::vector<const BufferInfo>> array(
            std::atomic_load(&mInputBuffers));
    BufferInfoIterator it = findClientBuffer(array, buffer);
@@ -94,7 +97,7 @@ status_t ACodecBufferChannel::queueSecureInputBuffer(
        const uint8_t *iv, CryptoPlugin::Mode mode, CryptoPlugin::Pattern pattern,
        const CryptoPlugin::SubSample *subSamples, size_t numSubSamples,
        AString *errorDetailMsg) {
    if (!hasCryptoOrDescrambler()) {
    if (!hasCryptoOrDescrambler() || mDealer == nullptr) {
        return -ENOSYS;
    }
    std::shared_ptr<const std::vector<const BufferInfo>> array(