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

Commit 6ace94d2 authored by Dongwon Kang's avatar Dongwon Kang
Browse files

MPEG4Extractor: check size for yrrc box

Test: stagefright -s poc_file
Bug: 62133227
Change-Id: Iafefac39764ce01b4dde414b9f152c9ea71810e9
parent 8818bf1f
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -2597,6 +2597,13 @@ status_t MPEG4Extractor::parse3GPPMetaData(off64_t offset, size_t size, int dept
        }
        case FOURCC('y', 'r', 'r', 'c'):
        {
            if (size < 6) {
                delete[] buffer;
                buffer = NULL;
                ALOGE("b/62133227");
                android_errorWriteLog(0x534e4554, "62133227");
                return ERROR_MALFORMED;
            }
            char tmp[5];
            uint16_t year = U16_AT(&buffer[4]);

@@ -2619,6 +2626,8 @@ status_t MPEG4Extractor::parse3GPPMetaData(off64_t offset, size_t size, int dept

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