[vlc-commits] png: fix memory leak

Hannes Domani git at videolan.org
Fri Feb 26 17:33:30 CET 2016


vlc | branch: master | Hannes Domani <ssbssa at yahoo.de> | Tue Feb 23 20:13:52 2016 +0100| [5fce6b1a92f60219ae50d009a307fe2e1a185615] | committer: Jean-Baptiste Kempf

png: fix memory leak

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/codec/png.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/modules/codec/png.c b/modules/codec/png.c
index ad2b600..fa46d84 100644
--- a/modules/codec/png.c
+++ b/modules/codec/png.c
@@ -395,9 +395,6 @@ static block_t *EncodeBlock(encoder_t *p_enc, picture_t *p_pic)
     if( p_info == NULL )
         goto error;
 
-    png_infop p_end_info = png_create_info_struct( p_png );
-    if( p_end_info == NULL ) goto error;
-
     png_set_IHDR( p_png, p_info,
             p_enc->fmt_in.video.i_visible_width,
             p_enc->fmt_in.video.i_visible_height,
@@ -416,7 +413,7 @@ static block_t *EncodeBlock(encoder_t *p_enc, picture_t *p_pic)
         if( p_sys->b_error ) goto error;
     }
 
-    png_write_end( p_png, p_end_info );
+    png_write_end( p_png, p_info );
     if( p_sys->b_error ) goto error;
 
     png_destroy_write_struct( &p_png, &p_info );



More information about the vlc-commits mailing list