goldfish: handle null handle
Reviewed-by: Aaron Ruby <aruby@blackberry.com> Acked-by: Yonggang Luo <luoyonggang@gmail.com> Acked-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27246>
This commit is contained in:
@@ -44,7 +44,14 @@ void GoldfishGralloc::acquire(AHardwareBuffer* ahb) { AHardwareBuffer_acquire(ah
|
||||
void GoldfishGralloc::release(AHardwareBuffer* ahb) { AHardwareBuffer_release(ahb); }
|
||||
|
||||
uint32_t GoldfishGralloc::getHostHandle(native_handle_t const* handle) {
|
||||
return cb_handle_t::from(handle)->hostHandle;
|
||||
const uint32_t INVALID_HOST_HANDLE = 0;
|
||||
|
||||
const cb_handle_t* cb = cb_handle_t::from(handle);
|
||||
if (cb) {
|
||||
return cb->hostHandle;
|
||||
} else {
|
||||
return INVALID_HOST_HANDLE;
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t GoldfishGralloc::getHostHandle(const AHardwareBuffer* ahb) {
|
||||
|
||||
Reference in New Issue
Block a user