]> git.sesse.net Git - vlc/commitdiff
Fixed segfault with spdif mixer.
authorLaurent Aimar <fenrir@videolan.org>
Thu, 3 Sep 2009 20:37:16 +0000 (22:37 +0200)
committerLaurent Aimar <fenrir@videolan.org>
Thu, 3 Sep 2009 20:40:02 +0000 (22:40 +0200)
 The aout core use a hack to avoid useless memcpy: the buffer in which
to mix is the same as the one in the first active input fifo.

modules/audio_mixer/spdif.c

index 0af800f33fc328cdbfbad2dd220512300abedc18..f06fad2c547cddab25adc6d644e2e93db3985d6e 100644 (file)
@@ -29,6 +29,8 @@
 # include "config.h"
 #endif
 
+#include <assert.h>
+
 #include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_aout.h>
@@ -84,7 +86,7 @@ static void DoWork( aout_mixer_t * p_mixer, aout_buffer_t * p_buffer )
         p_input = p_mixer->input[++i];
 
     aout_buffer_t * p_old_buffer = aout_FifoPop( NULL, &p_input->fifo );
-    aout_BufferFree( p_old_buffer );
+    assert( p_old_buffer == p_buffer );
 
     /* Empty other FIFOs to avoid a memory leak. */
     for ( i++; i < p_mixer->input_count; i++ )