mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-30 04:45:36 +00:00
mfvideosrc: Fix buffer leak
The allocated buffer should be released Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3496>
This commit is contained in:
parent
7300e51fbe
commit
d87d33d3fe
1 changed files with 6 additions and 2 deletions
|
@ -435,16 +435,20 @@ gst_mf_video_src_create (GstPushSrc * pushsrc, GstBuffer ** buffer)
|
||||||
ret = GST_BASE_SRC_CLASS (parent_class)->alloc (GST_BASE_SRC (self), 0,
|
ret = GST_BASE_SRC_CLASS (parent_class)->alloc (GST_BASE_SRC (self), 0,
|
||||||
GST_VIDEO_INFO_SIZE (&self->info), &buf);
|
GST_VIDEO_INFO_SIZE (&self->info), &buf);
|
||||||
|
|
||||||
if (ret != GST_FLOW_OK)
|
if (ret != GST_FLOW_OK) {
|
||||||
|
gst_clear_buffer (&buf);
|
||||||
return ret;
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
ret = gst_mf_source_object_fill (self->source, buf);
|
ret = gst_mf_source_object_fill (self->source, buf);
|
||||||
} else {
|
} else {
|
||||||
ret = gst_mf_source_object_create (self->source, &buf);
|
ret = gst_mf_source_object_create (self->source, &buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ret != GST_FLOW_OK)
|
if (ret != GST_FLOW_OK) {
|
||||||
|
gst_clear_buffer (&buf);
|
||||||
return ret;
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
GST_BUFFER_OFFSET (buf) = self->n_frames;
|
GST_BUFFER_OFFSET (buf) = self->n_frames;
|
||||||
GST_BUFFER_OFFSET_END (buf) = GST_BUFFER_OFFSET (buf) + 1;
|
GST_BUFFER_OFFSET_END (buf) = GST_BUFFER_OFFSET (buf) + 1;
|
||||||
|
|
Loading…
Reference in a new issue