From: Eunhae Choi Date: Mon, 19 Jun 2017 01:55:58 +0000 (+0900) Subject: rtph265depay : fix mem leak X-Git-Tag: submit/tizen/20170707.065345~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=77da569222b81ffe33a399df61aa3264c27e653b;p=platform%2Fupstream%2Fgst-plugins-bad.git rtph265depay : fix mem leak Change-Id: I6ed5269baca45d8ef2b11aa0647a65a72f33100f --- diff --git a/ext/directfb/dfbvideosink.c b/ext/directfb/dfbvideosink.c index 900c6b169..f9dbb603c 100644 --- a/ext/directfb/dfbvideosink.c +++ b/ext/directfb/dfbvideosink.c @@ -37,7 +37,7 @@ * This mode handles navigation events for every input device supported by * the DirectFB library, it will * look for available video modes in the fb.modes file and try to switch - * the framebuffer video mode to the most suitable one. Depending on + * the framebuffer video mode to the most suitable one. Depending on * hardware acceleration capabilities the element will handle scaling or not. * If no acceleration is available it will do clipping or centering of the * video frames respecting the original aspect ratio. @@ -45,15 +45,15 @@ * * * - * Embedded: this mode will render video frames in a + * Embedded: this mode will render video frames in a * #GstDfbVideoSink:surface provided by the * application developer. This is a more advanced usage of the element and - * it is required to integrate video playback in existing + * it is required to integrate video playback in existing * DirectFB applications. * * * When using this mode the element just renders to the - * #GstDfbVideoSink:surface provided by the + * #GstDfbVideoSink:surface provided by the * application, that means it won't handle navigation events and won't resize * the #GstDfbVideoSink:surface to fit video * frames geometry. Application has to implement the necessary code to grab @@ -62,8 +62,8 @@ * * * - * For both modes the element implements a buffer pool allocation system to - * optimize memory allocation time and handle reverse negotiation. Indeed if + * For both modes the element implements a buffer pool allocation system to + * optimize memory allocation time and handle reverse negotiation. Indeed if * you insert an element like videoscale in the pipeline the video sink will * negotiate with it to try get a scaled video for either the fullscreen layout * or the application provided external #GstDfbVideoSink:surface. @@ -796,7 +796,7 @@ gst_dfbvideosink_setup (GstDfbVideoSink * dfbvideosink) dfbvideosink->backbuffer = FALSE; dfbvideosink->pixel_format = DSPF_UNKNOWN; - /* If we do it all by ourself we create the DirectFB context, get the + /* If we do it all by ourself we create the DirectFB context, get the primary layer and use a fullscreen configuration */ if (!dfbvideosink->ext_surface) { GST_DEBUG_OBJECT (dfbvideosink, "no external surface, taking over " diff --git a/gst/rtp/gstrtph265depay.c b/gst/rtp/gstrtph265depay.c index bfc2e13a0..55615b703 100644 --- a/gst/rtp/gstrtph265depay.c +++ b/gst/rtp/gstrtph265depay.c @@ -320,6 +320,7 @@ static gboolean gst_rtp_h265_set_src_caps (GstRtpH265Depay * rtph265depay) { gboolean res; + GstCaps *old_caps; GstCaps *srccaps; if (!rtph265depay->byte_stream && @@ -531,9 +532,9 @@ gst_rtp_h265_set_src_caps (GstRtpH265Depay * rtph265depay) gst_buffer_unref (codec_data); } - if (gst_pad_has_current_caps (GST_RTP_BASE_DEPAYLOAD_SRCPAD (rtph265depay))) { - GstCaps *old_caps = - gst_pad_get_current_caps (GST_RTP_BASE_DEPAYLOAD_SRCPAD (rtph265depay)); + old_caps = + gst_pad_get_current_caps (GST_RTP_BASE_DEPAYLOAD_SRCPAD (rtph265depay)); + 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 @@ -566,6 +567,7 @@ gst_rtp_h265_set_src_caps (GstRtpH265Depay * rtph265depay) gst_caps_unref (tmp_caps); } + gst_caps_unref (old_caps); } else { res = gst_pad_set_caps (GST_RTP_BASE_DEPAYLOAD_SRCPAD (rtph265depay),