vlc | branch: master | Thomas Guillem <[email protected]> | 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();

_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to