[vlc-commits] avcodec: fix invalid free

Thomas Guillem git at videolan.org
Thu Jul 30 17:40:04 CEST 2015


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Jul 30 17:37:34 2015 +0200| [3fc28a0bc620ea3668181eb24ddb0b5f0d00e869] | committer: Thomas Guillem

avcodec: fix invalid free

Initialize frame to NULL before goto end

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

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

diff --git a/modules/codec/avcodec/audio.c b/modules/codec/avcodec/audio.c
index c3164a6..bfb1c8d 100644
--- a/modules/codec/avcodec/audio.c
+++ b/modules/codec/avcodec/audio.c
@@ -244,6 +244,7 @@ static block_t *DecodeAudio( decoder_t *p_dec, block_t **pp_block )
 {
     decoder_sys_t *p_sys = p_dec->p_sys;
     AVCodecContext *ctx = p_sys->p_context;
+    AVFrame *frame = NULL;
 
     if( !pp_block || !*pp_block )
         return NULL;
@@ -290,7 +291,7 @@ static block_t *DecodeAudio( decoder_t *p_dec, block_t **pp_block )
         p_block->i_flags |= BLOCK_FLAG_PRIVATE_REALLOCATED;
     }
 
-    AVFrame *frame = av_frame_alloc();
+    frame = av_frame_alloc();
     if (unlikely(frame == NULL))
         goto end;
 



More information about the vlc-commits mailing list