[vlc-devel] [PATCH 2/4] png: fix memory leak

Hannes Domani ssbssa at yahoo.de
Tue Feb 23 20:13:52 CET 2016


---
 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 );
-- 
2.7.0



More information about the vlc-devel mailing list