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

Commit 0f5974b7 authored by Edwin Wong's avatar Edwin Wong Committed by Automerger Merge Worker
Browse files

Fix double free of play policy in a race condition. am: 4b86f1db am: 02dcf3a9 am: 23a3c612

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

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ia4e985f64760afe719b74558f89fc1f9138b3c05
parents dc995bf3 23a3c612
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -109,6 +109,7 @@ status_t DrmPlugin::getKeyRequest(
}

void DrmPlugin::setPlayPolicy() {
    android::Mutex::Autolock lock(mPlayPolicyLock);
    mPlayPolicy.clear();
    mPlayPolicy.add(kQueryKeyLicenseType, kStreaming);
    mPlayPolicy.add(kQueryKeyPlayAllowed, kTrue);
+1 −0
Original line number Diff line number Diff line
@@ -262,6 +262,7 @@ private:
    void initProperties();
    void setPlayPolicy();

    android::Mutex mPlayPolicyLock;
    android::KeyedVector<String8, String8> mPlayPolicy;
    android::KeyedVector<String8, String8> mStringProperties;
    android::KeyedVector<String8, Vector<uint8_t>> mByteArrayProperties;
+1 −0
Original line number Diff line number Diff line
@@ -304,6 +304,7 @@ Return<void> DrmPlugin::getKeyRequest_1_2(
}

void DrmPlugin::setPlayPolicy() {
    android::Mutex::Autolock lock(mPlayPolicyLock);
    mPlayPolicy.clear();

    KeyValue policy;
+1 −0
Original line number Diff line number Diff line
@@ -406,6 +406,7 @@ private:
    int64_t mCloseSessionOkCount;
    int64_t mCloseSessionNotOpenedCount;
    uint32_t mNextSecureStopId;
    android::Mutex mPlayPolicyLock;

    // set by property to mock error scenarios
    Status_V1_2 mMockError;