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

Commit 1b70bf90 authored by Marco Nelissen's avatar Marco Nelissen Committed by android-build-merger
Browse files

Merge "Fix potential NULL dereference" am: ccf56a09 am: 485046c6

am: 47341917

Change-Id: Ie2cab2e5ca4828c4fb6d8ae35a35ee34c0933ab3
parents 1c61b7dd 47341917
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -51,7 +51,7 @@ status_t CallbackDataSource::initCheck() const {
}

ssize_t CallbackDataSource::readAt(off64_t offset, void* data, size_t size) {
    if (mMemory == NULL) {
    if (mMemory == NULL || data == NULL) {
        return -1;
    }

+7 −1
Original line number Diff line number Diff line
@@ -3889,7 +3889,12 @@ status_t MPEG4Source::parseSampleAuxiliaryInformationSizes(
        return OK;
    }
    if (smplcnt > mCurrentSampleInfoAllocSize) {
        mCurrentSampleInfoSizes = (uint8_t*) realloc(mCurrentSampleInfoSizes, smplcnt);
        uint8_t * newPtr =  (uint8_t*) realloc(mCurrentSampleInfoSizes, smplcnt);
        if (newPtr == NULL) {
            ALOGE("failed to realloc %u -> %u", mCurrentSampleInfoAllocSize, smplcnt);
            return NO_MEMORY;
        }
        mCurrentSampleInfoSizes = newPtr;
        mCurrentSampleInfoAllocSize = smplcnt;
    }

@@ -3928,6 +3933,7 @@ status_t MPEG4Source::parseSampleAuxiliaryInformationOffsets(
    if (entrycount > mCurrentSampleInfoOffsetsAllocSize) {
        uint64_t *newPtr = (uint64_t *)realloc(mCurrentSampleInfoOffsets, entrycount * 8);
        if (newPtr == NULL) {
            ALOGE("failed to realloc %u -> %u", mCurrentSampleInfoOffsetsAllocSize, entrycount * 8);
            return NO_MEMORY;
        }
        mCurrentSampleInfoOffsets = newPtr;