changeset 21811:ff1d5576063f

Do not access ogg_d->subs after freeing it.
author reimar
date Fri, 05 Jan 2007 18:02:18 +0000
parents 7a36d3332133
children 858481c34c3b
files libmpdemux/demux_ogg.c
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_ogg.c	Fri Jan 05 15:41:00 2007 +0000
+++ b/libmpdemux/demux_ogg.c	Fri Jan 05 18:02:18 2007 +0000
@@ -1600,7 +1600,12 @@
   if(ogg_d->subs)
   {
     for (i = 0; i < ogg_d->num_sub; i++)
+    {
+      os = &ogg_d->subs[i];
       ogg_stream_clear(&ogg_d->subs[i].stream);
+      if(os->vi_inited)
+        vorbis_info_clear(&os->vi);
+    }
     free(ogg_d->subs);
   }
   if(ogg_d->syncpoints)
@@ -1612,11 +1617,6 @@
       if (ogg_d->text_langs[i]) free(ogg_d->text_langs[i]);
     free(ogg_d->text_langs);
   }
-  if(demuxer->audio->id > -1 && demuxer->audio->id < ogg_d->num_sub) {
-    os = &ogg_d->subs[demuxer->audio->id];
-    if(os->vi_inited)
-      vorbis_info_clear(&os->vi);
-  }
   free(ogg_d);
 }