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

Steve Lhomme robux4 at ycbcr.xyz
Thu Mar 15 09:49:01 CET 2018


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;
-- 
2.14.2



More information about the vlc-devel mailing list