mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 14:26:43 +00:00
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:
parent
24af97a7d1
commit
5c3318227b
1 changed files with 6 additions and 5 deletions
|
@ -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;
|
||||
}
|
||||
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 *
|
||||
|
|
Loading…
Reference in a new issue