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

Commit 1cdd52c0 authored by Kim Sungyeon's avatar Kim Sungyeon Committed by Hsiaoan
Browse files

VT: Check track's validity when dequeue access unit



[Problem] RTPSource crashes when it stops.
[Cause] AccessUnitComplete can happen even after Disconnect is happened.
        At that time, RTPSource try to access non-valid track
        that already cleared from track vector.
[Solution] Check the vector size before access a track.

Bug: 383206566
Flag: EXEMPT refactor
Test: Basic Video call function(b/383206566 #comment62)

Change-Id: I2833fe77df9f3ddaf695894fc87a1a80eb29b55f
Signed-off-by: default avatarKim Sungyeon <sy85.kim@samsung.com>
parent 523b6910
Loading
Loading
Loading
Loading
+24 −23
Original line number Diff line number Diff line
@@ -432,8 +432,8 @@ void NuPlayer::RTPSource::onMessageReceived(const sp<AMessage> &msg) {

            // Implicitly assert on valid trackIndex here, which we ensure by
            // never removing tracks.
            if (trackIndex < mTracks.size()) {
                TrackInfo *info = &mTracks.editItemAt(trackIndex);

                sp<AnotherPacketSource> source = info->mSource;
                if (source != NULL) {
                    uint32_t rtpTime;
@@ -459,6 +459,7 @@ void NuPlayer::RTPSource::onMessageReceived(const sp<AMessage> &msg) {

                    source->queueAccessUnit(accessUnit);
                }
            }

            break;
        }