changeset 21500:e7e7f397f991

Fix memleaks caused by missing vorbis/theora_info/comment_clear calls. Code still seems wrong to me for multiple audio tracks, since there is only one vorbis comment/info entry for the demuxer, not one per track?
author reimar
date Wed, 06 Dec 2006 10:46:50 +0000
parents 2e6ebc42fa9a
children aecea8c8afee
files libmpdemux/demux_ogg.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_ogg.c	Wed Dec 06 10:42:30 2006 +0000
+++ b/libmpdemux/demux_ogg.c	Wed Dec 06 10:46:50 2006 +0000
@@ -994,6 +994,8 @@
 		   n_video - 1);
 	    if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_video_header(sh_v->bih,MSGL_V);
 	}
+	theora_comment_clear(&cc);
+	theora_info_clear(&inf);
 #   endif /* HAVE_OGGTHEORA */
     } else if (pack.bytes >= 4 && !strncmp (&pack.packet[0], "fLaC", 4)) {
 	sh_a = new_sh_audio_aid(demuxer,ogg_d->num_sub, n_audio);
@@ -1621,6 +1623,8 @@
       if (ogg_d->text_langs[i]) free(ogg_d->text_langs[i]);
     free(ogg_d->text_langs);
   }
+  vorbis_info_clear(&ogg_d->vi);
+  vorbis_comment_clear(&ogg_d->vc);
   free(ogg_d);
 }