Commit d15a4777 authored by Thomas Guillem's avatar Thomas Guillem Committed by Rémi Denis-Courmont

picture_pool: fix refcount leak if pic_lock fails.

Signed-off-by: default avatarRémi Denis-Courmont <remi@remlab.net>
parent 3cfb5fe9
......@@ -277,8 +277,10 @@ picture_t *picture_pool_Get(picture_pool_t *pool)
if (!atomic_compare_exchange_strong(&picture->gc.refcount, &refs, 1))
continue;
if (pool->pic_lock != NULL && pool->pic_lock(picture) != 0)
if (pool->pic_lock != NULL && pool->pic_lock(picture) != 0) {
atomic_store(&picture->gc.refcount, 0);
continue;
}
/* */
picture->p_next = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment