egl: check for surface creation failure

This commit is contained in:
Victor Brekenfeld 2020-05-10 20:06:10 +02:00
parent 7c4ca4e524
commit bf3e8b4d10
1 changed files with 4 additions and 0 deletions

View File

@ -72,6 +72,10 @@ impl<N: native::NativeSurface> EGLSurface<N> {
ffi::egl::CreateWindowSurface(**display, config, native.ptr(), surface_attributes.as_ptr()) ffi::egl::CreateWindowSurface(**display, config, native.ptr(), surface_attributes.as_ptr())
})?; })?;
if surface == ffi::egl::NO_SURFACE {
return Err(EGLError::BadSurface);
}
Ok(EGLSurface { Ok(EGLSurface {
display, display,
native, native,