diff --git a/src/wayland-eglsurface.c b/src/wayland-eglsurface.c index 4e4dcff..ae6cafc 100644 --- a/src/wayland-eglsurface.c +++ b/src/wayland-eglsurface.c @@ -265,11 +265,13 @@ wlEglSendDamageEvent(WlEglSurface *surface, } image = pop_acquired_image(surface); - if (image) { - surface->ctx.currentBuffer = image->buffer; - image->attached = EGL_TRUE; + if (!image) { + return EGL_FALSE; } + surface->ctx.currentBuffer = image->buffer; + image->attached = EGL_TRUE; + /* * Send our explicit sync acquire and release points. This needs to be done * as part of the surface attach as it is a protocol error to specify these