va: jpegenc: Fix a memory leak when filter sink caps

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7547>
This commit is contained in:
He Junyan 2024-09-06 23:44:53 +08:00 committed by GStreamer Marge Bot
parent dfccbd52f4
commit 6bb294343b

View file

@ -1216,8 +1216,10 @@ _filter_sink_caps (GstCaps * sinkcaps)
guint32 fourcc;
val = gst_structure_get_value (st, "drm-format");
if (!val)
if (!val) {
gst_structure_free (st);
continue;
}
if (G_VALUE_HOLDS_STRING (val)) {
format_str = g_value_get_string (val);
@ -1253,8 +1255,10 @@ _filter_sink_caps (GstCaps * sinkcaps)
gst_caps_features_copy (features));
} else {
val = gst_structure_get_value (st, "format");
if (!val)
if (!val) {
gst_structure_free (st);
continue;
}
if (G_VALUE_HOLDS_STRING (val)) {
format_str = g_value_get_string (val);
@ -1299,7 +1303,6 @@ _filter_sink_caps (GstCaps * sinkcaps)
return ret;
}
gboolean
gst_va_jpeg_enc_register (GstPlugin * plugin, GstVaDevice * device,
GstCaps * sink_caps, GstCaps * src_caps, guint rank,