[vlc-commits] image: fix mem leak in error path

Thomas Guillem git at videolan.org
Thu Jan 28 17:00:58 CET 2016


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Jan 28 16:59:19 2016 +0100| [4ef240cf4a9cd26e8a7ae1a94e2b17c1ce976332] | committer: Thomas Guillem

image: fix mem leak in error path

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

 src/misc/image.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/misc/image.c b/src/misc/image.c
index 78342f9..1a76b82 100644
--- a/src/misc/image.c
+++ b/src/misc/image.c
@@ -135,7 +135,11 @@ static picture_t *ImageRead( image_handler_t *p_image, block_t *p_block,
     if( !p_image->p_dec )
     {
         p_image->p_dec = CreateDecoder( p_image->p_parent, p_fmt_in );
-        if( !p_image->p_dec ) return NULL;
+        if( !p_image->p_dec )
+        {
+            block_Release(p_block);
+            return NULL;
+        }
     }
 
     p_block->i_pts = p_block->i_dts = mdate();



More information about the vlc-commits mailing list