Use calloc instead of malloc

Use calloc instead of malloc. This will ensure that length in set to zero if no
length is provided from gstreamer.

By: Lars Munch <lars@segv.dk>



SVN revision: 39145
This commit is contained in:
Gustavo Sverzut Barbieri 2009-02-22 17:14:44 +00:00
parent 2c65d61731
commit 1fbacf6f28
1 changed files with 3 additions and 3 deletions

View File

@ -93,7 +93,7 @@ file_new_decoded_pad_cb(GstElement *decodebin,
GstElement *queue;
GstPad *videopad;
vsink = (Emotion_Video_Sink *)malloc(sizeof(Emotion_Video_Sink));
vsink = (Emotion_Video_Sink *)calloc(1, sizeof(Emotion_Video_Sink));
if (!vsink) return;
if (!ecore_list_append(ev->video_sinks, vsink))
{
@ -121,7 +121,7 @@ file_new_decoded_pad_cb(GstElement *decodebin,
Emotion_Audio_Sink *asink;
GstPad *audiopad;
asink = (Emotion_Audio_Sink *)malloc(sizeof(Emotion_Audio_Sink));
asink = (Emotion_Audio_Sink *)calloc(1, sizeof(Emotion_Audio_Sink));
if (!asink) return;
if (!ecore_list_append(ev->audio_sinks, asink))
{
@ -146,7 +146,7 @@ emotion_video_sink_new(Emotion_Gstreamer_Video *ev)
if (!ev) return NULL;
vsink = (Emotion_Video_Sink *)malloc(sizeof(Emotion_Video_Sink));
vsink = (Emotion_Video_Sink *)calloc(1, sizeof(Emotion_Video_Sink));
if (!vsink) return NULL;
if (!ecore_list_append(ev->video_sinks, vsink))