[vlc-devel] [PATCH] picture_pool: don't crash for pictures not coming from a picture pool
Rémi Denis-Courmont
remi at remlab.net
Thu Mar 15 18:44:09 CET 2018
Le torstaina 15. maaliskuuta 2018, 10.49.01 EET Steve Lhomme a écrit :
> ie pictures coming from picture_NewFromResource()
> ---
> src/misc/picture_pool.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/src/misc/picture_pool.c b/src/misc/picture_pool.c
> index 7b5a82bfba..4b267ead4c 100644
> --- a/src/misc/picture_pool.c
> +++ b/src/misc/picture_pool.c
> @@ -303,6 +303,8 @@ bool picture_pool_OwnsPic(picture_pool_t *pool,
> picture_t *pic) while (priv->gc.destroy != picture_pool_ReleasePicture) {
> pic = priv->gc.opaque;
> priv = (picture_priv_t *)pic;
> + if (pic == NULL)
> + return false;
> }
>
> uintptr_t sys = (uintptr_t)priv->gc.opaque;
It works with the current narrow set of uses of gc.opaque, but that does not
look sane in the long run.
--
雷米‧德尼-库尔蒙
https://www.remlab.net/
More information about the vlc-devel
mailing list