From: Eunhae Choi Date: Fri, 16 Jun 2017 09:45:07 +0000 (+0900) Subject: rtph264depay : fix mem leak X-Git-Tag: accepted/tizen/4.0/unified/20170816.012648~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=27f8f9050035dcba54848756b20ab9435b4e9704;p=platform%2Fupstream%2Fgst-plugins-good.git rtph264depay : fix mem leak Change-Id: Ic6255805254c15b9c01cdadcbecb2111e2a9bf7a --- diff --git a/gst/rtp/gstrtph264depay.c b/gst/rtp/gstrtph264depay.c index cd05e62..ea07b65 100644 --- a/gst/rtp/gstrtph264depay.c +++ b/gst/rtp/gstrtph264depay.c @@ -292,6 +292,7 @@ gst_rtp_h264_set_src_caps (GstRtpH264Depay * rtph264depay) { gboolean res; GstCaps *srccaps; + GstCaps *old_caps; if (!rtph264depay->byte_stream && (!rtph264depay->new_codec_data || @@ -422,10 +423,10 @@ gst_rtp_h264_set_src_caps (GstRtpH264Depay * rtph264depay) } - if (gst_pad_has_current_caps (GST_RTP_BASE_DEPAYLOAD_SRCPAD (rtph264depay))) { - GstCaps *old_caps = - gst_pad_get_current_caps (GST_RTP_BASE_DEPAYLOAD_SRCPAD (rtph264depay)); + old_caps = + gst_pad_get_current_caps (GST_RTP_BASE_DEPAYLOAD_SRCPAD (rtph264depay)); + if (old_caps != NULL) { /* Only update the caps if they are not equal. For * AVC we don't update caps if only the codec_data * changes. This is the same behaviour as in h264parse @@ -456,6 +457,7 @@ gst_rtp_h264_set_src_caps (GstRtpH264Depay * rtph264depay) gst_caps_unref (tmp_caps); } + gst_caps_unref (old_caps); } else { res = gst_pad_set_caps (GST_RTP_BASE_DEPAYLOAD_SRCPAD (rtph264depay),