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

Commit 0ad03bc5 authored by Fredrik Rosin's avatar Fredrik Rosin Committed by Henrik Baard
Browse files

Prevent double disconnects in RTSPSource

Prevent a null pointer from occuring by checking that we are not
already disconnected before performing a disconnect, in case
multiple disconnects have been issued.

Change-Id: Ib88800cd246086fd57f77d10748d41b1aefe2084
parent a9aa6baa
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -459,6 +459,10 @@ void NuPlayer::RTSPSource::onConnected() {
}

void NuPlayer::RTSPSource::onDisconnected(const sp<AMessage> &msg) {
    if (mState == DISCONNECTED) {
        return;
    }

    status_t err;
    CHECK(msg->findInt32("result", &err));
    CHECK_NE(err, (status_t)OK);