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

Commit 5e96386a authored by Lajos Molnar's avatar Lajos Molnar
Browse files

stagefright: avoid buffer overflow in base64 decoder

Bug: 62673128
Change-Id: Id5f04b772aaca3184879bd5bca453ad9e82c7f94
parent 222dca47
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -78,8 +78,7 @@ sp<ABuffer> decodeBase64(const AString &s) {
        accum = (accum << 6) | value;

        if (((i + 1) % 4) == 0) {
            out[j++] = (accum >> 16);

            if (j < outLen) { out[j++] = (accum >> 16); }
            if (j < outLen) { out[j++] = (accum >> 8) & 0xff; }
            if (j < outLen) { out[j++] = accum & 0xff; }