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

Commit 431503c1 authored by Zhijun He's avatar Zhijun He
Browse files

Camera3Device: fix dereferencing null pointer crash

It's possible that the dump is called during the device shutdown
process, where the buffer manager could be already torn down. Add
null check before calling the dump function.

Bug: 27500853
Change-Id: I179eb7ac1e81be2c196833b2c88488cd59fe2cc5
parent 9322ba85
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -534,9 +534,11 @@ status_t Camera3Device::dump(int fd, const Vector<String16> &args) {
        mOutputStreams[i]->dump(fd,args);
    }

    if (mBufferManager != NULL) {
        lines = String8("    Camera3 Buffer Manager:\n");
        write(fd, lines.string(), lines.size());
        mBufferManager->dump(fd, args);
    }

    lines = String8("    In-flight requests:\n");
    if (mInFlightMap.size() == 0) {