From 5bdf86fed7df8f67a289c5dd819af8c242e66ccc Mon Sep 17 00:00:00 2001 From: Claudio Ciccani Date: Sat, 7 Oct 2006 09:59:49 +0000 Subject: Fixed segfault in demux_asf_dispose(). CVS patchset: 8330 CVS date: 2006/10/07 09:59:49 --- src/demuxers/demux_asf.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/demuxers/demux_asf.c b/src/demuxers/demux_asf.c index 3e3f01bc5..92042c6bc 100644 --- a/src/demuxers/demux_asf.c +++ b/src/demuxers/demux_asf.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: demux_asf.c,v 1.184 2006/10/03 07:30:51 valtri Exp $ + * $Id: demux_asf.c,v 1.185 2006/10/07 09:59:49 klan Exp $ * * demultiplexer for asf streams * @@ -1708,21 +1708,23 @@ static int demux_asf_send_chunk (demux_plugin_t *this_gen) { static void demux_asf_dispose (demux_plugin_t *this_gen) { demux_asf_t *this = (demux_asf_t *) this_gen; - int i; - for (i=0; iasf_header->stream_count; i++) { - asf_demux_stream_t *asf_stream; + if (this->asf_header) { + int i; + + for (i=0; iasf_header->stream_count; i++) { + asf_demux_stream_t *asf_stream; - asf_stream = &this->streams[i]; - if( asf_stream->buffer ) { - free( asf_stream->buffer ); - asf_stream->buffer = NULL; + asf_stream = &this->streams[i]; + if (asf_stream->buffer) { + free (asf_stream->buffer); + asf_stream->buffer = NULL; + } } - } - - if (this->asf_header) - asf_header_delete(this->asf_header); + asf_header_delete (this->asf_header); + } + free (this); } -- cgit v1.2.3