From 30d4761592205d5a6413200054ed858685af1752 Mon Sep 17 00:00:00 2001 From: Andri Yngvason Date: Mon, 2 Dec 2024 21:37:42 +0000 Subject: [PATCH] ext-image-copy-capture: Check for buffer allocation failure --- src/ext-image-copy-capture.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ext-image-copy-capture.c b/src/ext-image-copy-capture.c index 2c573e5..3734bb5 100644 --- a/src/ext-image-copy-capture.c +++ b/src/ext-image-copy-capture.c @@ -183,6 +183,11 @@ static void ext_image_copy_capture_schedule_capture(struct ext_image_copy_captur config_buffers(self); self->buffer = wv_buffer_pool_acquire(self->pool); + if (!self->buffer) { + self->parent.on_done(SCREENCOPY_FATAL, NULL, self->parent.userdata); + return; + } + self->buffer->domain = self->cursor ? WV_BUFFER_DOMAIN_CURSOR : WV_BUFFER_DOMAIN_OUTPUT;