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

Commit eb204f82 authored by Nick Kralevich's avatar Nick Kralevich Committed by Android Git Automerger
Browse files

am b919a3a3: am 64290793: Merge "Fix integer underflow in ESDS processing" into klp-dev

* commit 'b919a3a3':
  Fix integer underflow in ESDS processing
parents 475de998 b919a3a3
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -136,6 +136,8 @@ status_t ESDS::parseESDescriptor(size_t offset, size_t size) {
    --size;

    if (streamDependenceFlag) {
        if (size < 2)
            return ERROR_MALFORMED;
        offset += 2;
        size -= 2;
    }
@@ -145,11 +147,15 @@ status_t ESDS::parseESDescriptor(size_t offset, size_t size) {
            return ERROR_MALFORMED;
        }
        unsigned URLlength = mData[offset];
        if (URLlength >= size)
            return ERROR_MALFORMED;
        offset += URLlength + 1;
        size -= URLlength + 1;
    }

    if (OCRstreamFlag) {
        if (size < 2)
            return ERROR_MALFORMED;
        offset += 2;
        size -= 2;