diff options
-rw-r--r-- | system/OpenglSystemCommon/HostConnection.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/system/OpenglSystemCommon/HostConnection.cpp b/system/OpenglSystemCommon/HostConnection.cpp index d1300731..79c92fe5 100644 --- a/system/OpenglSystemCommon/HostConnection.cpp +++ b/system/OpenglSystemCommon/HostConnection.cpp @@ -200,7 +200,14 @@ public: virtual uint32_t 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; + } } virtual int getFormat(native_handle_t const* handle) |