diff --git a/src/backend/egl/surface.rs b/src/backend/egl/surface.rs index da09e8e..422845d 100644 --- a/src/backend/egl/surface.rs +++ b/src/backend/egl/surface.rs @@ -72,6 +72,10 @@ impl EGLSurface { ffi::egl::CreateWindowSurface(**display, config, native.ptr(), surface_attributes.as_ptr()) })?; + if surface == ffi::egl::NO_SURFACE { + return Err(EGLError::BadSurface); + } + Ok(EGLSurface { display, native,