]> git.sesse.net Git - vlc/blobdiff - modules/video_filter/audiobargraph_v.c
Replace argument = realloc( argument, size ); with realloc_or_free() in modules/...
[vlc] / modules / video_filter / audiobargraph_v.c
index 269fed2cc21252b8003c60378d34b56ccbc5b0f8..2ca709a30a16d2899defe34f91d4f13feea2b77d 100644 (file)
@@ -38,6 +38,8 @@
 #include <vlc_image.h>
 #include <vlc_osd.h>
 
+#include <vlc_memory.h>
+
 #ifdef LoadImage
 #   undef LoadImage
 #endif
@@ -940,7 +942,9 @@ void parse_i_values( BarGraph_t *p_BarGraph, char *i_values)
     res = strtok_r(i_values, delim, &tok);
     while (res != NULL) {
         p_BarGraph->nbChannels++;
-        p_BarGraph->i_values = (int*)realloc(p_BarGraph->i_values, p_BarGraph->nbChannels*sizeof(int));
+        p_BarGraph->i_values = realloc_or_free(p_BarGraph->i_values,
+                                          p_BarGraph->nbChannels*sizeof(int));
+        assert(p_BarGraph->i_values);
         p_BarGraph->i_values[p_BarGraph->nbChannels-1] = __MAX( __MIN( atof(res)*p_BarGraph->scale, p_BarGraph->scale ), 0 );
         res = strtok_r(NULL, delim, &tok);
     }