X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fvideo_filter%2Faudiobargraph_v.c;fp=modules%2Fvideo_filter%2Faudiobargraph_v.c;h=2ca709a30a16d2899defe34f91d4f13feea2b77d;hb=15643af12d9eb61eff8a8e89d8170f3d2b73d7e1;hp=269fed2cc21252b8003c60378d34b56ccbc5b0f8;hpb=4e4720311a10bf0917cc826369438c6565d56a4f;p=vlc diff --git a/modules/video_filter/audiobargraph_v.c b/modules/video_filter/audiobargraph_v.c index 269fed2cc2..2ca709a30a 100644 --- a/modules/video_filter/audiobargraph_v.c +++ b/modules/video_filter/audiobargraph_v.c @@ -38,6 +38,8 @@ #include #include +#include + #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); }