[vlc-commits] avcodec: fix memory leak

Hannes Domani git at videolan.org
Wed Oct 21 18:34:17 CEST 2015


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

avcodec: fix memory leak

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
(cherry picked from commit 7a06d63a3b8be54d7994d68b4ac7c9c05210a815)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 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 34c8352..ae2f9dd 100644
--- a/modules/codec/avcodec/audio.c
+++ b/modules/codec/avcodec/audio.c
@@ -395,6 +395,7 @@ 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;
     }
 #else
     {
@@ -449,6 +450,7 @@ 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