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

Commit f2acb7a0 authored by Ray Essick's avatar Ray Essick
Browse files

keep tx3g{Buffer,Size,Filled} in sync

wasn't clearing size/filled when we cleared buffer.

Bug: 151159638
Test: poc, but it didn't fail either before or after the patch
parent 06675ff3
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1075,6 +1075,8 @@ status_t MPEG4Extractor::parseChunk(off64_t *offset, int depth) {
                    // drop it now to reduce our footprint
                    free(mLastTrack->mTx3gBuffer);
                    mLastTrack->mTx3gBuffer = NULL;
                    mLastTrack->mTx3gFilled = 0;
                    mLastTrack->mTx3gSize = 0;
                }

                const char *mime;
@@ -2787,6 +2789,10 @@ status_t MPEG4Extractor::parseChunk(off64_t *offset, int depth) {
            // if those apps are compensating for it, we'd break them with such a change
            //

            if (mLastTrack->mTx3gBuffer == NULL) {
                mLastTrack->mTx3gSize = 0;
                mLastTrack->mTx3gFilled = 0;
            }
            if (mLastTrack->mTx3gSize - mLastTrack->mTx3gFilled < chunk_size) {
                size_t growth = kTx3gGrowth;
                if (growth < chunk_size) {