diff options
author | Víctor Manuel Jáquez Leal <vjaquez@igalia.com> | 2017-04-20 18:44:41 +0200 |
---|---|---|
committer | Víctor Manuel Jáquez Leal <vjaquez@igalia.com> | 2017-04-20 18:48:22 +0200 |
commit | 5c3318227b8b33071fa649662e21b337804e020c (patch) | |
tree | f214cae3646ed21df6ecacd1592c9d2ba228adcc | |
parent | 24af97a7d106c1ba7cd1fe607e427f728ab9cf9c (diff) |
vaapipostproc: fixes for memory leaks
The use of gst_vaapi_value_set_format() and gst_structure_*_value()
requires to clear the used GValue to avoid a memory leak.
-rw-r--r-- | gst/vaapi/gstvaapipostprocutil.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/gst/vaapi/gstvaapipostprocutil.c b/gst/vaapi/gstvaapipostprocutil.c index 1780df3f..84035ea5 100644 --- a/gst/vaapi/gstvaapipostprocutil.c +++ b/gst/vaapi/gstvaapipostprocutil.c @@ -48,6 +48,7 @@ _transform_format (GstVaapiPostproc * postproc, GstCapsFeatures * features, return; gst_structure_set_value (structure, "format", &value); + g_value_unset (&value); } static void @@ -615,11 +616,11 @@ _set_preferred_format (GstStructure * outs, GstVideoFormat format) if (format == GST_VIDEO_FORMAT_UNKNOWN || format == GST_VIDEO_FORMAT_ENCODED) return FALSE; - if (gst_vaapi_value_set_format (&value, format)) { - gst_structure_set_value (outs, "format", &value); - return TRUE; - } - return FALSE; + if (!gst_vaapi_value_set_format (&value, format)) + return FALSE; + gst_structure_set_value (outs, "format", &value); + g_value_unset (&value); + return TRUE; } static GstCaps * |