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

Commit 8cc90e4d authored by Edwin Wong's avatar Edwin Wong
Browse files

Fix findId spinning if session id is not found. *** DO NOT MERGE ***

This fix is already in master.

If session id is not found, the iterator is not incremented
such that the end() condition is reached.

The Test:
How is this bug discovered:
Calling AMediaDrm_closeSession() after AMediaDrm_provideKeyResponse()
results in spinning.

This cl is tested on nyc-mr2-dev branch using a NativeClearKeySystemTest.
After the test is run, the previous screen will be restored.

Test: ANDROID_BUILD_TOP= ./android-cts/tools/cts-tradefed run cts -m CtsMediaTestCases --test android.media.cts.NativeClearKeySystemTest#testClearKeyPlaybackCenc

bug: 32235473
Change-Id: I2bbbd8a4e92a4c926eff538a67d9719c1b6ec7d0
parent 341d2236
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -221,8 +221,7 @@ media_status_t AMediaDrm_setOnEventListener(AMediaDrm *mObj, AMediaDrmEventListe


static bool findId(AMediaDrm *mObj, const AMediaDrmByteArray &id, List<idvec_t>::iterator &iter) {
    iter = mObj->mIds.begin();
    while (iter != mObj->mIds.end()) {
    for (iter = mObj->mIds.begin(); iter != mObj->mIds.end(); ++iter) {
        if (iter->array() == id.ptr && iter->size() == id.length) {
            return true;
        }