]> git.sesse.net Git - vlc/blobdiff - modules/audio_filter/converter/dtstospdif.c
Replace argument = realloc( argument, size ); with realloc_or_free() in modules/...
[vlc] / modules / audio_filter / converter / dtstospdif.c
index 7d62c6d178c6c255535989f72dc47a4c695287c1..49a61e82e1c8bb889ffb3dbb02760abf807f4292 100644 (file)
 # include "config.h"
 #endif
 
+#include <assert.h>
+
 #include <vlc_common.h>
 #include <vlc_plugin.h>
 
 #include <vlc_aout.h>
 #include <vlc_filter.h>
 
+#include <vlc_memory.h>
+
 /*****************************************************************************
  * Local structures
  *****************************************************************************/
@@ -125,8 +129,9 @@ static block_t *DoWork( filter_t * p_filter, block_t * p_in_buf )
                   p_filter->p_sys->i_frame_size, p_in_buf->i_buffer );
 
         p_filter->p_sys->i_frame_size = p_in_buf->i_buffer;
-        p_filter->p_sys->p_buf = realloc( p_filter->p_sys->p_buf,
-                                          p_in_buf->i_buffer * 3 );
+        p_filter->p_sys->p_buf = realloc_or_free( p_filter->p_sys->p_buf,
+                                                  p_in_buf->i_buffer * 3 );
+        assert( p_filter->p_sys->p_buf );
         p_filter->p_sys->i_frames = 0;
     }