[vlc-commits] avcodec: fix double free on error

Rémi Denis-Courmont git at videolan.org
Thu Oct 16 19:23:00 CEST 2014


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Oct 16 20:20:12 2014 +0300| [9bf41d6aeb35a121ce9c96adb21852ca69eb106b] | committer: Rémi Denis-Courmont

avcodec: fix double free on error

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

 modules/codec/avcodec/audio.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/modules/codec/avcodec/audio.c b/modules/codec/avcodec/audio.c
index 71e9f30..530181a 100644
--- a/modules/codec/avcodec/audio.c
+++ b/modules/codec/avcodec/audio.c
@@ -389,6 +389,7 @@ static block_t *DecodeAudio( decoder_t *p_dec, block_t **pp_block )
     if( p_block->i_buffer == 0 )
     {   /* Done with this buffer */
         block_Release( p_block );
+        p_block = NULL;
         *pp_block = NULL;
     }
 
@@ -476,7 +477,8 @@ static block_t *DecodeAudio( decoder_t *p_dec, block_t **pp_block )
 end:
     *pp_block = NULL;
 drop:
-    block_Release(p_block);
+    if( p_block != NULL )
+        block_Release(p_block);
     return NULL;
 }
 



More information about the vlc-commits mailing list