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

Commit 26a586c2 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

am: 1b70bf90

Change-Id: I5e2f0eb5a7acd7cf1d0b30ef70314943e18d8bce
parents aadfdb27 1b70bf90
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
@@ -3992,7 +3992,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;
    }

@@ -4031,6 +4036,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;