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

Commit e6e98e77 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "StagefrighRecorder:check mWriter before using fd"

parents 225bf118 14c10ebb
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -400,12 +400,14 @@ status_t StagefrightRecorder::setNextOutputFile(int fd) {
        return -EBADF;
    }

    // start with a clean, empty file
    ftruncate(fd, 0);
    if (mWriter == NULL) {
    if (mWriter == nullptr) {
        ALOGE("setNextOutputFile failed. Writer has been freed");
        return INVALID_OPERATION;
    }

    // start with a clean, empty file
    ftruncate(fd, 0);

    return mWriter->setNextFd(fd);
}