[vlc-commits] avcodec: free extradata after closing the context

Rémi Denis-Courmont git at videolan.org
Sat Sep 13 12:12:29 CEST 2014


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Sep 13 12:59:48 2014 +0300| [f8fa5d7361e1fee44212b28a3f084fa7164f8c9e] | committer: Rémi Denis-Courmont

avcodec: free extradata after closing the context

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

 modules/codec/avcodec/avcodec.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/modules/codec/avcodec/avcodec.c b/modules/codec/avcodec/avcodec.c
index eb7dd7b..fb83b5e 100644
--- a/modules/codec/avcodec/avcodec.c
+++ b/modules/codec/avcodec/avcodec.c
@@ -342,9 +342,6 @@ static void CloseDecoder( vlc_object_t *p_this )
         break;
     }
 
-    av_free( p_sys->p_context->extradata );
-    p_sys->p_context->extradata = NULL;
-
     if( !p_sys->b_delayed_open )
     {
         vlc_avcodec_lock();
@@ -353,6 +350,7 @@ static void CloseDecoder( vlc_object_t *p_this )
         msg_Dbg( p_dec, "ffmpeg codec (%s) stopped", p_sys->p_codec->name );
     }
 
+    av_freep( &p_sys->p_context->extradata );
     avcodec_free_context( &p_sys->p_context );
     free( p_sys );
 }



More information about the vlc-commits mailing list