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

Commit cf14e8ca authored by sadiqsada's avatar sadiqsada
Browse files

mFilterCount cannot be negative

mFilterCount is a reference counter for Filters, and it's decremented
when Filter.stop() is called. Added a check to make sure the value
is not decremented when it's already 0.

Bug: 288170590
Test: atest VtsHalTvTunerTargetTest
Change-Id: I72fe7e5c4babd7e7426d8a52b40887a8c411ce81
parent 25a0f6fe
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -366,10 +366,12 @@ Filter::~Filter() {
::ndk::ScopedAStatus Filter::stop() {
    ALOGV("%s", __FUNCTION__);

    if (mFilterCount > 0) {
        mFilterCount -= 1;
    if (mFilterCount == 0) {
        if (mFilterCount.load() == 0) {
            mDemux->setIptvThreadRunning(false);
        }
    }

    mFilterThreadRunning = false;
    if (mFilterThread.joinable()) {