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

Commit bc96e471 authored by Andy McFadden's avatar Andy McFadden
Browse files

Added null check

Don't dereference "handle" if it's NULL.

Bug 13348578

Change-Id: Ifa6758616c41cf84467af6db29c779d26901a01c
parent ce9f107c
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line 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);
    buffer = reinterpret_cast<void*>(static_cast<int*>(buffer) + sizeNeeded);
    size -= sizeNeeded;
    size -= sizeNeeded;
    if (handle) {
        fds += handle->numFds;
        fds += handle->numFds;
        count -= handle->numFds;
        count -= handle->numFds;
    }


    return NO_ERROR;
    return NO_ERROR;
}
}