Added null check

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

Bug 13348578

Change-Id: Ifa6758616c41cf84467af6db29c779d26901a01c
This commit is contained in:
Andy McFadden 2014-03-17 16:48:23 -07:00
parent ce9f107c9d
commit bc96e4714f
1 changed files with 4 additions and 2 deletions

View File

@ -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;
fds += handle->numFds;
count -= handle->numFds;
if (handle) {
fds += handle->numFds;
count -= handle->numFds;
}
return NO_ERROR;
}