[vlc-devel] [PATCH] picture_pool: fix double mutex_unlock if pic_lock fails
Rémi Denis-Courmont
remi at remlab.net
Mon Nov 3 11:44:33 CET 2014
Le 2014-11-03 13:22, Thomas Guillem a écrit :
> ---
> src/misc/picture_pool.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/src/misc/picture_pool.c b/src/misc/picture_pool.c
> index 15d0791..dac7ef6 100644
> --- a/src/misc/picture_pool.c
> +++ b/src/misc/picture_pool.c
> @@ -253,7 +253,6 @@ picture_t *picture_pool_Get(picture_pool_t *pool)
> vlc_mutex_lock(&pool->lock);
> sys->in_use = false;
> pool->refs--;
> - vlc_mutex_unlock(&pool->lock);
> continue;
> }
The patch is obviously correct.
I suspect you are abusing the lock feature though. Locking a picture
should only fail in exceptional circumstances such as OOM. To retain
"busy" pictures, the video output must use
picture_Hold()/picture_Release(), not lock/unlock.
--
Rémi Denis-Courmont
More information about the vlc-devel
mailing list