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

Commit e4ebac5f authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Catch nullptr possibilities in NuMediaExtractor" into udc-dev am: 05263be8

parents 5beabca7 05263be8
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -298,6 +298,9 @@ status_t NuMediaExtractor::getFileFormat(sp<AMessage> *format) const {
    size_t psshsize;
    if (meta->findData(kKeyPssh, &type, &pssh, &psshsize)) {
        sp<ABuffer> buf = new ABuffer(psshsize);
        if (buf->data() == nullptr) {
            return -ENOMEM;
        }
        memcpy(buf->data(), pssh, psshsize);
        (*format)->setBuffer("pssh", buf);
    }
@@ -308,6 +311,9 @@ status_t NuMediaExtractor::getFileFormat(sp<AMessage> *format) const {
    if (meta->findData(kKeySlowMotionMarkers, &type, &slomoMarkers, &slomoMarkersSize)
            && slomoMarkersSize > 0) {
        sp<ABuffer> buf = new ABuffer(slomoMarkersSize);
        if (buf->data() == nullptr) {
            return -ENOMEM;
        }
        memcpy(buf->data(), slomoMarkers, slomoMarkersSize);
        (*format)->setBuffer("slow-motion-markers", buf);
    }
@@ -639,6 +645,7 @@ status_t NuMediaExtractor::appendVorbisNumPageSamples(
        numPageSamples = -1;
    }

    // caller has verified there is sufficient space
    // insert, including accounting for the space used.
    memcpy((uint8_t *)buffer->data() + mbuf->range_length(),
           &numPageSamples,