# HG changeset patch # User reimar # Date 1124784206 0 # Node ID f443f849531bed1b6cb7842ab51e102ce1e06584 # Parent 8a2585bc494f61e9dcbdd4d40a3e35d7f94963ec Do not free demuxer before using demuxer->desc->type (happened when using -audiofile). diff -r 8a2585bc494f -r f443f849531b libmpdemux/demux_demuxers.c --- 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); } diff -r 8a2585bc494f -r f443f849531b libmpdemux/demuxer.c --- 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]);