[Bug 787714] gstomxh265enc:Fix Memory leak in error case

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Tue Sep 19 12:36:46 UTC 2017


https://bugzilla.gnome.org/show_bug.cgi?id=787714

Tim-Philipp Müller <t.i.m at zen.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #360039|none                        |needs-work
             status|                            |

--- Comment #6 from Tim-Philipp Müller <t.i.m at zen.co.uk> ---
Comment on attachment 360039
  --> https://bugzilla.gnome.org/attachment.cgi?id=360039
attached the path

Thanks for the patch!

>--- a/omx/gstomxh265enc.c
>+++ b/omx/gstomxh265enc.c
>@@ -457,8 +457,10 @@ gst_omx_h265_enc_get_caps (GstOMXVideoEnc * enc, GstOMXPort * port,
>   err =
>       gst_omx_component_get_parameter (GST_OMX_VIDEO_ENC (self)->enc,
>       OMX_IndexParamVideoProfileLevelCurrent, &param);
>-  if (err != OMX_ErrorNone && err != OMX_ErrorUnsupportedIndex)
>-    return NULL;
>+  if (err != OMX_ErrorNone && err != OMX_ErrorUnsupportedIndex) {
>+	gst_caps_unref (caps);
>+	return NULL;
>+    }
> 
>   if (err == OMX_ErrorNone) {
>     switch (param.eProfile) {


I think a nicer fix would be to move the

  caps = gst_caps_new_simple(...)

after the _get_parameter(), i.e. jst before the if (err == OMX_ErrorNone) {...

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list