[vlc-commits] avcodec: fix memory leak

Hannes Domani git at videolan.org
Thu Jul 30 00:25:35 CEST 2015


vlc | branch: master | Hannes Domani <ssbssa at yahoo.de> | Tue Jul 28 18:12:27 2015 +0200| [7a06d63a3b8be54d7994d68b4ac7c9c05210a815] | committer: Jean-Baptiste Kempf

avcodec: fix memory leak

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

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

 modules/codec/avcodec/audio.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/modules/codec/avcodec/audio.c b/modules/codec/avcodec/audio.c
index e1be3a5..c3164a6 100644
--- a/modules/codec/avcodec/audio.c
+++ b/modules/codec/avcodec/audio.c
@@ -368,6 +368,7 @@ static block_t *DecodeAudio( decoder_t *p_dec, block_t **pp_block )
         p_block = vlc_av_frame_Wrap(frame);
         if (unlikely(p_block == NULL))
             goto drop;
+        frame = NULL;
     }
 
     if (p_sys->b_extract)
@@ -403,6 +404,7 @@ static block_t *DecodeAudio( decoder_t *p_dec, block_t **pp_block )
 end:
     *pp_block = NULL;
 drop:
+    av_frame_free(&frame);
     if( p_block != NULL )
         block_Release(p_block);
     return NULL;



More information about the vlc-commits mailing list