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

Commit 2177f21c authored by Wei Jia's avatar Wei Jia
Browse files

MPEG4Writer: add check to ensure no integer overflow on allocation.

Bug: 20674584
Change-Id: I77ef1891abf0a20994840a87fa99e55a62f40a70
parent 9cf332ca
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -113,6 +113,8 @@ private:
            mCurrTableEntriesElement(NULL) {
            CHECK_GT(mElementCapacity, 0);
            CHECK_GT(mEntryCapacity, 0);
            // Ensure no integer overflow on allocation in add().
            CHECK_LT(mEntryCapacity, UINT32_MAX / mElementCapacity);
        }

        // Free the allocated memory.