Don't free the front buffer if screencopy fails

It is possible for `screencopy_failed` to be called without
the front buffer ever being set, such as when the output is dpms-off.

Fixes #65
pull/95/head
Arnavion 2020-12-18 16:48:39 -08:00 committed by Andri Yngvason
parent 5ae312c1b4
commit a9b2d93568
1 changed files with 2 additions and 1 deletions

View File

@ -191,7 +191,8 @@ static void screencopy_failed(void* data,
screencopy__stop(self);
wv_buffer_pool_release(self->pool, self->front);
if (self->front)
wv_buffer_pool_release(self->pool, self->front);
self->front = NULL;
self->status = SCREENCOPY_FAILED;