fix GraphicBuffer::flatten crash issue when handle is null

Change-Id: I0d3727e4366cac355791e52cb7790bf8f3c51527
Signed-off-by: Jun Jiang <jun.a.jiang@intel.com>
This commit is contained in:
Jun Jiang 2014-04-29 14:15:36 +08:00
parent 108ed9fa94
commit e2d1157381
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;
}