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.
This commit is contained in:
Víctor Manuel Jáquez Leal 2017-04-20 18:44:41 +02:00
parent 24af97a7d1
commit 5c3318227b

View file

@ -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 *