From bf3e8b4d1069738597fc6264d50cc1924a91aae4 Mon Sep 17 00:00:00 2001 From: Victor Brekenfeld Date: Sun, 10 May 2020 20:06:10 +0200 Subject: [PATCH] egl: check for surface creation failure --- src/backend/egl/surface.rs | 4 ++++ 1 file changed, 4 insertions(+) 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,