aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--system/egl/egl.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/system/egl/egl.cpp b/system/egl/egl.cpp
index 47742f9d..606bf29b 100644
--- a/system/egl/egl.cpp
+++ b/system/egl/egl.cpp
@@ -620,7 +620,10 @@ egl_pbuffer_surface_t::~egl_pbuffer_surface_t()
// Destroy a pending surface and set it to NULL.
static void s_destroyPendingSurfaceAndSetNull(EGLSurface* surface) {
- if (!s_display.isSurface(surface)) {
+ if (!surface)
+ return;
+
+ if (!s_display.isSurface(*surface)) {
*surface = NULL;
return;
}