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

Commit 279d2aa7 authored by Lucas Gates's avatar Lucas Gates
Browse files

Tuner Default HAL Fix bug in TS size calculation

The variable mPesSizeLeft is sometimes being set to a negative value
when it reads from TS data because of conversions from our int8_t vector. This is incorrect, as these sizes are defined to always be positive. Our vectors cannot easily be changed due to our AIDL interfaces, but the SizeLeft variable can be made unsigned to fix the issue.

Bug: 237819905
Test: Manually with cuttlefish and TS input to the DVR with
large values for size bytes. Can also manually test the
result of similar C++ expression to show the behavior.

Change-Id: Iae925cc3c505891b732434fb7c3ffadf7af95411
parent 2b55903f
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -803,7 +803,7 @@ void Filter::updateRecordOutput(vector<int8_t>& data) {
            }
        }

        int endPoint = min(184, mPesSizeLeft);
        uint32_t endPoint = min(184u, mPesSizeLeft);
        // append data and check size
        vector<int8_t>::const_iterator first = mFilterOutput.begin() + i + 4;
        vector<int8_t>::const_iterator last = mFilterOutput.begin() + i + 4 + endPoint;
@@ -885,7 +885,7 @@ void Filter::updateRecordOutput(vector<int8_t>& data) {
            }
        }

        int endPoint = min(184, mPesSizeLeft);
        uint32_t endPoint = min(184u, mPesSizeLeft);
        // append data and check size
        vector<int8_t>::const_iterator first = mFilterOutput.begin() + i + 4;
        vector<int8_t>::const_iterator last = mFilterOutput.begin() + i + 4 + endPoint;
+1 −1
Original line number Diff line number Diff line
@@ -260,7 +260,7 @@ class Filter : public BnFilter {

    // temp handle single PES filter
    // TODO handle mulptiple Pes filters
    int mPesSizeLeft = 0;
    uint32_t mPesSizeLeft = 0;
    vector<int8_t> mPesOutput;

    // A map from data id to ion handle