1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-30 02:52:10 +00:00

Prevent segfault when filter chain is empty (e.g. because all

filters returned AF_DETACH). Fixes bugzilla bug #293.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15313 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2005-05-01 09:23:31 +00:00
parent b7f3811b29
commit e331e6b94f

View File

@ -368,6 +368,11 @@ int af_init(af_stream_t* s, int force_output)
if(AF_OK != af_reinit(s,s->first))
return -1;
// make sure the chain is not empty and valid (e.g. because of AF_DETACH)
if (!s->first)
if (!af_append(s,s->first,"dummy") || AF_OK != af_reinit(s,s->first))
return -1;
// If force_output isn't set do not compensate for output format
if(!force_output){
memcpy(&s->output, s->last->data, sizeof(af_data_t));