[vlc-commits] demux: ogg: correctly free vorbis info (refs #18015)

Francois Cartegnie git at videolan.org
Wed Feb 15 11:03:59 CET 2017


vlc/vlc-2.2 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Feb 15 10:57:01 2017 +0100| [395a54a2d0173f2380730d8549c6888a2d391145] | committer: Francois Cartegnie

demux: ogg: correctly free vorbis info (refs #18015)

bp of b8b6cc3bb8e24c0d556ce2c40fc1fad65921cdb0

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

 modules/demux/ogg.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/modules/demux/ogg.c b/modules/demux/ogg.c
index 94d8894..202580c 100644
--- a/modules/demux/ogg.c
+++ b/modules/demux/ogg.c
@@ -2199,10 +2199,12 @@ static void Ogg_CleanSpecificData( logical_stream_t *p_stream )
 #ifdef HAVE_LIBVORBIS
     if ( p_stream->fmt.i_codec == VLC_CODEC_VORBIS )
     {
-        vorbis_info_clear( p_stream->special.vorbis.p_info );
-        FREENULL( p_stream->special.vorbis.p_info );
-        vorbis_comment_clear( p_stream->special.vorbis.p_comment );
-        FREENULL( p_stream->special.vorbis.p_comment );
+        if( p_stream->special.vorbis.p_info )
+            vorbis_info_clear( p_stream->special.vorbis.p_info );
+        p_stream->special.vorbis.p_info = NULL;
+        if( p_stream->special.vorbis.p_comment )
+            vorbis_comment_clear( p_stream->special.vorbis.p_comment );
+        p_stream->special.vorbis.p_comment = NULL;
         p_stream->special.vorbis.i_headers_flags = 0;
     }
 #else



More information about the vlc-commits mailing list