Use calloc instead of malloc
authorbarbieri <barbieri@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sun, 22 Feb 2009 17:14:44 +0000 (17:14 +0000)
committerbarbieri <barbieri@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sun, 22 Feb 2009 17:14:44 +0000 (17:14 +0000)
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>

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/emotion@39145 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/modules/gstreamer/emotion_gstreamer_pipeline.c

index cf1e28b..5fcd742 100644 (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))