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

Commit 485046c6 authored by Marco Nelissen's avatar Marco Nelissen Committed by android-build-merger
Browse files

Merge "Fix potential NULL dereference"

am: ccf56a09

Change-Id: I6476a47b0f5d28731d858cfcc32eb489750e20f1
parents d2767161 ccf56a09
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;