mirror of
https://github.com/mpv-player/mpv
synced 2025-01-09 01:36:25 +01:00
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. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25472 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
75e3df67ae
commit
77e2ce680b
@ -383,6 +383,7 @@ int demux_fill_buffer(demuxer_t *demux,demux_stream_t *ds){
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user