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

Commit e2d11573 authored by Jun Jiang's avatar Jun Jiang
Browse files

fix GraphicBuffer::flatten crash issue when handle is null



Change-Id: I0d3727e4366cac355791e52cb7790bf8f3c51527
Signed-off-by: default avatarJun Jiang <jun.a.jiang@intel.com>
parent 108ed9fa
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -235,8 +235,10 @@ status_t GraphicBuffer::flatten(void*& buffer, size_t& size, int*& fds, size_t&

    buffer = reinterpret_cast<void*>(static_cast<int*>(buffer) + sizeNeeded);
    size -= sizeNeeded;
    if (handle) {
        fds += handle->numFds;
        count -= handle->numFds;
    }

    return NO_ERROR;
}