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

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

am a2a912a7: am cacf9084: am 534ab954: am 10441a6f: am f02c5c9e: am 4d8ed149:...

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

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


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

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