[vlc-devel] [PATCH] picture_pool: don't crash for pictures not coming from a picture pool

Rémi Denis-Courmont remi at remlab.net
Mon Mar 19 17:23:46 CET 2018


Le perjantaina 16. maaliskuuta 2018, 9.23.51 EET Steve Lhomme a écrit :
> Le 15/03/2018 à 18:44, Rémi Denis-Courmont a écrit :
> > 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.
> 
> This whole function may go away with how we plan to do things in 4.0

This function _must_ go away regardless of what happens. It's broken by 
design, and it's only there to work around bugs in some video outputs.

-- 
雷米‧德尼-库尔蒙
https://www.remlab.net/



More information about the vlc-devel mailing list