[vlc-commits] audiobargraph: check allocation
Rémi Denis-Courmont
git at videolan.org
Thu Mar 20 22:11:03 CET 2014
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Mar 20 22:35:15 2014 +0200| [0ef6a5e13e2cd43d4c786c3ca0228b1a166636c1] | committer: Rémi Denis-Courmont
audiobargraph: check allocation
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0ef6a5e13e2cd43d4c786c3ca0228b1a166636c1
---
modules/audio_filter/audiobargraph_a.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/modules/audio_filter/audiobargraph_a.c b/modules/audio_filter/audiobargraph_a.c
index 5d4caec..b29d60f 100644
--- a/modules/audio_filter/audiobargraph_a.c
+++ b/modules/audio_filter/audiobargraph_a.c
@@ -172,10 +172,8 @@ static block_t *DoWork( filter_t *p_filter, block_t *p_in_buf )
float i_value[AOUT_CHAN_MAX];
float ch;
float max = 0.0;
- //char *message = (char*)malloc(255*sizeof(char));
char message[255];
int nbChannels = 0;
- ValueDate_t* new = NULL;
ValueDate_t* current = NULL;
float sum;
int count = 0;
@@ -202,7 +200,7 @@ static block_t *DoWork( filter_t *p_filter, block_t *p_in_buf )
if (p_sys->silence) {
/* 2 - store the new value */
- new = (ValueDate_t*)malloc(sizeof(ValueDate_t));
+ ValueDate_t *new = xmalloc(sizeof(*new));
new->value = max;
new->date = p_in_buf->i_pts;
new->next = NULL;
More information about the vlc-commits
mailing list