v4l2src: release buffer if create fails

gst_base_src_get_range does not expect a buffer to be returned in
the error case, so we are leaking a reference here if create fails.

https://bugzilla.gnome.org/show_bug.cgi?id=775014
This commit is contained in:
Philipp Zabel 2016-11-24 14:41:52 +01:00 committed by Nicolas Dufresne
parent 34db78b645
commit 65826f819a

View file

@ -873,6 +873,7 @@ alloc_failed:
}
error:
{
gst_buffer_replace (buf, NULL);
if (ret == GST_V4L2_FLOW_LAST_BUFFER) {
GST_ELEMENT_ERROR (src, RESOURCE, FAILED,
("Driver returned a buffer with no payload, this most likely "