changeset 25444:acaa10e43c52

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.
author reimar
date Thu, 20 Dec 2007 11:21:02 +0000
parents 6ad285d014bf
children 959fca775f43
files libmpdemux/demuxer.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demuxer.c	Thu Dec 20 10:41:16 2007 +0000
+++ b/libmpdemux/demuxer.c	Thu Dec 20 11:21:02 2007 +0000
@@ -383,6 +383,7 @@
 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 @@
   }
   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;