[MPlayer-cvslog] r25472 - trunk/libmpdemux/demuxer.c

reimar subversion at mplayerhq.hu
Thu Dec 20 12:21:03 CET 2007


Author: reimar
Date: Thu Dec 20 12:21:02 2007
New Revision: 25472

Log:
Move ds->current=NULL; further up to the free_demux_packet.
This does not change behaviour in the normal case but avoids
a double-free if the function is aborted via a signal handler.


Modified:
   trunk/libmpdemux/demuxer.c

Modified: trunk/libmpdemux/demuxer.c
==============================================================================
--- trunk/libmpdemux/demuxer.c	(original)
+++ trunk/libmpdemux/demuxer.c	Thu Dec 20 12:21:02 2007
@@ -383,6 +383,7 @@ int demux_fill_buffer(demuxer_t *demux,d
 int ds_fill_buffer(demux_stream_t *ds){
   demuxer_t *demux=ds->demuxer;
   if(ds->current) free_demux_packet(ds->current);
+  ds->current=NULL;
   if( mp_msg_test(MSGT_DEMUXER,MSGL_DBG3) ){
     if(ds==demux->audio) mp_dbg(MSGT_DEMUXER,MSGL_DBG3,"ds_fill_buffer(d_audio) called\n");else
     if(ds==demux->video) mp_dbg(MSGT_DEMUXER,MSGL_DBG3,"ds_fill_buffer(d_video) called\n");else
@@ -431,7 +432,6 @@ int ds_fill_buffer(demux_stream_t *ds){
   }
   ds->buffer_pos=ds->buffer_size=0;
   ds->buffer=NULL;
-  ds->current=NULL;
   mp_msg(MSGT_DEMUXER,MSGL_V,"ds_fill_buffer: EOF reached (stream: %s)  \n",ds==demux->audio?"audio":"video");
   ds->eof=1;
   return 0;



More information about the MPlayer-cvslog mailing list