mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-06 14:32:31 +00:00
jpegenc: fix two leaks
Don't leak othercaps or jpegenc ref.
This commit is contained in:
parent
dc2662e22b
commit
035aead2d7
1 changed files with 8 additions and 2 deletions
|
@ -342,8 +342,10 @@ gst_jpegenc_getcaps (GstPad * pad)
|
||||||
|
|
||||||
othercaps = gst_pad_get_allowed_caps (jpegenc->srcpad);
|
othercaps = gst_pad_get_allowed_caps (jpegenc->srcpad);
|
||||||
if (othercaps == NULL ||
|
if (othercaps == NULL ||
|
||||||
gst_caps_is_empty (othercaps) || gst_caps_is_any (othercaps))
|
gst_caps_is_empty (othercaps) || gst_caps_is_any (othercaps)) {
|
||||||
return gst_caps_copy (gst_pad_get_pad_template_caps (pad));
|
caps = gst_caps_copy (gst_pad_get_pad_template_caps (pad));
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
caps = gst_caps_new_empty ();
|
caps = gst_caps_new_empty ();
|
||||||
templ = gst_pad_get_pad_template_caps (pad);
|
templ = gst_pad_get_pad_template_caps (pad);
|
||||||
|
@ -365,6 +367,10 @@ gst_jpegenc_getcaps (GstPad * pad)
|
||||||
gst_caps_merge_structure (caps, structure);
|
gst_caps_merge_structure (caps, structure);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
done:
|
||||||
|
|
||||||
|
gst_caps_replace (&othercaps, NULL);
|
||||||
gst_object_unref (jpegenc);
|
gst_object_unref (jpegenc);
|
||||||
|
|
||||||
return caps;
|
return caps;
|
||||||
|
|
Loading…
Reference in a new issue