mirror of
https://github.com/swaywm/sway.git
synced 2024-11-22 16:01:27 +00:00
view: check if the buffer was uploaded on save
wlr_surface_has_buffer() is insufficient; if a client has committed a buffer but it couldn't be applied, NULL deref happens in the next line.
This commit is contained in:
parent
0dfaf7ea63
commit
47263aca28
|
@ -1422,7 +1422,7 @@ static void view_save_buffer_iterator(struct wlr_surface *surface,
|
||||||
int sx, int sy, void *data) {
|
int sx, int sy, void *data) {
|
||||||
struct sway_view *view = data;
|
struct sway_view *view = data;
|
||||||
|
|
||||||
if (surface && wlr_surface_has_buffer(surface)) {
|
if (surface && surface->buffer) {
|
||||||
wlr_buffer_lock(&surface->buffer->base);
|
wlr_buffer_lock(&surface->buffer->base);
|
||||||
struct sway_saved_buffer *saved_buffer = calloc(1, sizeof(struct sway_saved_buffer));
|
struct sway_saved_buffer *saved_buffer = calloc(1, sizeof(struct sway_saved_buffer));
|
||||||
saved_buffer->buffer = surface->buffer;
|
saved_buffer->buffer = surface->buffer;
|
||||||
|
|
Loading…
Reference in a new issue