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

Commit 5614ca04 authored by tangcheng's avatar tangcheng
Browse files

Fix libgui cts crash bug



While enabling #define LOG_NDEBUG 0, run camera cts test command:
run cts -m CtsCameraTestCases -t android.hardware.camera2.cts.MultiViewTest#testSharedSurfaceImageReaderSwitch
the libgui will crash due to nullptr, fix this by add nullptr
judgement when pointing to the Graphicbuffer handle
Bug: 228349805

Signed-off-by: default avatartangcheng <tangcheng@xiaomi.com>
Change-Id: I69a84bdb5208b16df88f5f09f45c1a93ad2afe01
parent 0a9ada5c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -606,7 +606,8 @@ status_t BufferQueueProducer::dequeueBuffer(int* outSlot, sp<android::Fence>* ou
    BQ_LOGV("dequeueBuffer: returning slot=%d/%" PRIu64 " buf=%p flags=%#x",
            *outSlot,
            mSlots[*outSlot].mFrameNumber,
            mSlots[*outSlot].mGraphicBuffer->handle, returnFlags);
            mSlots[*outSlot].mGraphicBuffer != nullptr ?
            mSlots[*outSlot].mGraphicBuffer->handle : nullptr, returnFlags);

    if (outBufferAge) {
        *outBufferAge = mCore->mBufferAge;