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

Commit cacf9084 authored by Joshua J. Drake's avatar Joshua J. Drake Committed by Android Git Automerger
Browse files

am 534ab954: am 10441a6f: am f02c5c9e: am 4d8ed149: Prevent integer underflow if size is below 6

* commit '534ab954':
  Prevent integer underflow if size is below 6
parents d3061951 534ab954
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2471,6 +2471,10 @@ status_t MPEG4Extractor::parse3GPPMetaData(off64_t offset, size_t size, int dept
        int len16 = 0; // Number of UTF-16 characters

        // smallest possible valid UTF-16 string w BOM: 0xfe 0xff 0x00 0x00
        if (size < 6) {
            return ERROR_MALFORMED;
        }

        if (size - 6 >= 4) {
            len16 = ((size - 6) / 2) - 1; // don't include 0x0000 terminator
            framedata = (char16_t *)(buffer + 6);