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

Commit 3f252fe9 authored by Dongwon Kang's avatar Dongwon Kang Committed by Bryan Ferris
Browse files

MPEG4Extractor: check the default sample info before checking the validity of sample size.

Test: atest MediaPlayerDrmTest
Bug: 135215092, Bug: 124525515
Change-Id: I6383514acaf546734b320224342a61cbd362c4bf
parent 6081cd38
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -5053,15 +5053,15 @@ status_t MPEG4Source::parseSampleAuxiliaryInformationSizes(
    mCurrentSampleInfoCount = smplcnt;
    offset += 4;
    size -= 4;
    if (mCurrentDefaultSampleInfoSize != 0) {
        ALOGV("@@@@ using default sample info size of %d", mCurrentDefaultSampleInfoSize);
        return OK;
    }
    if(smplcnt > size) {
        ALOGW("b/124525515 - smplcnt(%u) > size(%ld)", (unsigned int)smplcnt, (unsigned long)size);
        android_errorWriteLog(0x534e4554, "124525515");
        return -EINVAL;
    }
    if (mCurrentDefaultSampleInfoSize != 0) {
        ALOGV("@@@@ using default sample info size of %d", mCurrentDefaultSampleInfoSize);
        return OK;
    }
    if (smplcnt > mCurrentSampleInfoAllocSize) {
        uint8_t * newPtr =  (uint8_t*) realloc(mCurrentSampleInfoSizes, smplcnt);
        if (newPtr == NULL) {