mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 11:36:00 +00:00
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
This commit is contained in:
@@ -366,9 +366,11 @@ Filter::~Filter() {
|
||||
::ndk::ScopedAStatus Filter::stop() {
|
||||
ALOGV("%s", __FUNCTION__);
|
||||
|
||||
mFilterCount -= 1;
|
||||
if (mFilterCount == 0) {
|
||||
mDemux->setIptvThreadRunning(false);
|
||||
if (mFilterCount > 0) {
|
||||
mFilterCount -= 1;
|
||||
if (mFilterCount.load() == 0) {
|
||||
mDemux->setIptvThreadRunning(false);
|
||||
}
|
||||
}
|
||||
|
||||
mFilterThreadRunning = false;
|
||||
|
||||
Reference in New Issue
Block a user