From: Wim Taymans Date: Wed, 14 Feb 2007 17:04:47 +0000 (+0000) Subject: gst/rtsp/sdpmessage.c: Clear stack allocated SDPMedia struct before calling _init... X-Git-Tag: 1.19.3~509^2~12177 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=df5916db2f6c17ffec8350e3818bcd2b346ff43f;p=platform%2Fupstream%2Fgstreamer.git gst/rtsp/sdpmessage.c: Clear stack allocated SDPMedia struct before calling _init() on it. Original commit message from CVS: * gst/rtsp/sdpmessage.c: (sdp_parse_line): As spotted by: Peter Kjellerstedt : Clear stack allocated SDPMedia struct before calling _init() on it. Clarify this in the docs as well. --- diff --git a/ChangeLog b/ChangeLog index 6c696a0..f99bdc9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-02-14 Wim Taymans + + * gst/rtsp/sdpmessage.c: (sdp_parse_line): + As spotted by: Peter Kjellerstedt : + Clear stack allocated SDPMedia struct before calling _init() on it. + Clarify this in the docs as well. + 2007-02-14 Jan Schmidt * ext/gconf/gstgconfaudiosink.c: (gst_gconf_audio_sink_reset), diff --git a/gst/rtsp/sdpmessage.c b/gst/rtsp/sdpmessage.c index 1adc6d7..256a8ce 100644 --- a/gst/rtsp/sdpmessage.c +++ b/gst/rtsp/sdpmessage.c @@ -186,6 +186,9 @@ sdp_message_new (SDPMessage ** msg) * with sdp_message_new(). This function is mostly used to initialize a message * allocated on the stack. sdp_message_uninit() undoes this operation. * + * When this function is invoked on newly allocated data (with malloc or on the + * stack), its contents should be set to 0 before calling this function. + * * Returns: a #RTSPResult. */ RTSPResult @@ -290,6 +293,9 @@ sdp_media_new (SDPMedia ** media) * with sdp_media_new(). This function is mostly used to initialize a media * allocated on the stack. sdp_media_uninit() undoes this operation. * + * When this function is invoked on newly allocated data (with malloc or on the + * stack), its contents should be set to 0 before calling this function. + * * Returns: a #RTSPResult. */ RTSPResult @@ -747,6 +753,7 @@ sdp_parse_line (SDPContext * c, gchar type, gchar * buffer) SDPMedia nmedia; c->state = SDP_MEDIA; + memset (&nmedia, 0, sizeof (nmedia)); sdp_media_init (&nmedia); READ_STRING (nmedia.media);