[MPlayer-cvslog] CVS: main/libaf af.c,1.44,1.45

Reimar Döffinger CVS syncmail at mplayerhq.hu
Sun May 1 11:23:34 CEST 2005


CVS change done by Reimar Döffinger CVS

Update of /cvsroot/mplayer/main/libaf
In directory mail:/var2/tmp/cvs-serv22352

Modified Files:
	af.c 
Log Message:
Prevent segfault when filter chain is empty (e.g. because all
filters returned AF_DETACH). Fixes bugzilla bug #293.


Index: af.c
===================================================================
RCS file: /cvsroot/mplayer/main/libaf/af.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- af.c	16 Apr 2005 16:48:15 -0000	1.44
+++ af.c	1 May 2005 09:23:31 -0000	1.45
@@ -368,6 +368,11 @@
   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));




More information about the MPlayer-cvslog mailing list