Skip to content

Commit

Permalink
ext-image-copy-capture: Check for buffer allocation failure
Browse files Browse the repository at this point in the history
  • Loading branch information
any1 committed Dec 2, 2024
1 parent 19ef01b commit 30d4761
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/ext-image-copy-capture.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 30d4761

Please sign in to comment.