Skip to content

Commit

Permalink
egl-wayland: Handle failure to acquire image in wlEglSendDamageEvent
Browse files Browse the repository at this point in the history
The image parameter of send_explicit_sync_points is assumed not to be
null, however this is a case the rest of the code handles. This causes
sporadic problems on KDE when running overnight as the image will not
be valid at some point, causing us to crash.

Fixes #143
  • Loading branch information
shiningdracon authored and amshafer committed Oct 31, 2024
1 parent 0cd471d commit 22898c6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/wayland-eglsurface.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 22898c6

Please sign in to comment.