changeset 16291:f443f849531b

Do not free demuxer before using demuxer->desc->type (happened when using -audiofile).
author reimar
date Tue, 23 Aug 2005 08:03:26 +0000
parents 8a2585bc494f
children f779d1c1c593
files libmpdemux/demux_demuxers.c libmpdemux/demuxer.c
diffstat 2 files changed, 2 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_demuxers.c	Tue Aug 23 07:56:29 2005 +0000
+++ b/libmpdemux/demux_demuxers.c	Tue Aug 23 08:03:26 2005 +0000
@@ -104,12 +104,6 @@
   }
 
   free(priv);
-  if(demuxer->info) {
-    for(i=0;demuxer->info[i] != NULL; i++)
-      free(demuxer->info[i]);
-    free(demuxer->info);
-  }
-  free(demuxer);
 }
   
 
--- a/libmpdemux/demuxer.c	Tue Aug 23 07:56:29 2005 +0000
+++ b/libmpdemux/demuxer.c	Tue Aug 23 08:03:26 2005 +0000
@@ -260,7 +260,7 @@
       demuxer->desc->close(demuxer);
     // Very ugly hack to make it behave like old implementation
     if (demuxer->desc->type == DEMUXER_TYPE_DEMUXERS)
-      return;
+      goto skip_streamfree;
     // free streams:
     for(i = 0; i < MAX_A_STREAMS; i++)
 	if(demuxer->a_streams[i]) free_sh_audio(demuxer->a_streams[i]);
@@ -272,6 +272,7 @@
     free_demuxer_stream(demuxer->audio);
     free_demuxer_stream(demuxer->video);
     free_demuxer_stream(demuxer->sub);
+skip_streamfree:
     if(demuxer->info) {
       for(i=0;demuxer->info[i] != NULL; i++)
 	free(demuxer->info[i]);