[vlc-commits] picture: fix double free when picture_Setup fails

Steve Lhomme git at videolan.org
Fri Dec 20 08:18:11 CET 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Dec 18 14:12:12 2019 +0100| [d583f4d06f75ca11c1982dfcd758c9c35b553f53] | committer: Steve Lhomme

picture: fix double free when picture_Setup fails

The picture (priv->picture which is the same pointer) was freed in
picture_InitPrivate() and then in picture_NewFromResource() /
picture_NewFromFormat().

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d583f4d06f75ca11c1982dfcd758c9c35b553f53
---

 src/misc/picture.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/src/misc/picture.c b/src/misc/picture.c
index 990277ef15..89b4ddee62 100644
--- a/src/misc/picture.c
+++ b/src/misc/picture.c
@@ -207,10 +207,7 @@ static bool picture_InitPrivate(const video_format_t *restrict p_fmt,
     p_picture->format = *p_fmt;
     /* Make sure the real dimensions are a multiple of 16 */
     if( picture_Setup( p_picture, p_fmt ) )
-    {
-        free( p_picture );
         return false;
-    }
 
     atomic_init(&p_picture->refs, 1);
     priv->gc.opaque = NULL;



More information about the vlc-commits mailing list