[vlc-commits] avcodec: fix pointer aliasing

Rémi Denis-Courmont git at videolan.org
Wed Oct 1 22:11:32 CEST 2014


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Oct  1 23:11:03 2014 +0300| [999814e7c7ac8d734a831597cf09415285d1d028] | committer: Rémi Denis-Courmont

avcodec: fix pointer aliasing

av_freep() requires a pointer to void *. Nothing else is defined.

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

 modules/codec/avcodec/avcodec.c |    2 +-
 modules/codec/avcodec/encoder.c |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/modules/codec/avcodec/avcodec.c b/modules/codec/avcodec/avcodec.c
index 88c21da..59be081 100644
--- a/modules/codec/avcodec/avcodec.c
+++ b/modules/codec/avcodec/avcodec.c
@@ -341,7 +341,7 @@ static void CloseDecoder( vlc_object_t *p_this )
 
     decoder_sys_t *p_sys = p_dec->p_sys;
 
-    av_freep( &p_sys->p_context->extradata );
+    av_free( p_sys->p_context->extradata );
     avcodec_free_context( &p_sys->p_context );
     free( p_sys );
 }
diff --git a/modules/codec/avcodec/encoder.c b/modules/codec/avcodec/encoder.c
index 4cdc572..12586bb 100644
--- a/modules/codec/avcodec/encoder.c
+++ b/modules/codec/avcodec/encoder.c
@@ -1408,7 +1408,8 @@ void CloseEncoder( vlc_object_t *p_this )
 #if (LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54, 28, 0))
     avcodec_free_frame( &p_sys->frame );
 #else
-    av_freep( &p_sys->frame );
+    av_free( p_sys->frame );
+    p_sys->frame = NULL;
 #endif
 
     vlc_avcodec_lock();



More information about the vlc-commits mailing list