mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 08:46:40 +00:00
gst/base/gstbasetransform.c: Fix a pretty good memleak.
Original commit message from CVS: * gst/base/gstbasetransform.c: (gst_base_transform_buffer_alloc): Fix a pretty good memleak.
This commit is contained in:
parent
4f74a712c4
commit
d32de37076
3 changed files with 27 additions and 4 deletions
|
@ -1,3 +1,8 @@
|
|||
2005-08-08 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
|
||||
|
||||
* gst/base/gstbasetransform.c: (gst_base_transform_buffer_alloc):
|
||||
Fix a pretty good memleak.
|
||||
|
||||
2005-08-08 Tim-Philipp Müller <tim at centricular dot net>
|
||||
|
||||
* gst/gstiterator.h:
|
||||
|
|
|
@ -535,6 +535,9 @@ gst_base_transform_buffer_alloc (GstPad * pad, guint64 offset, guint size,
|
|||
goto unknown_size;
|
||||
}
|
||||
|
||||
if (*buf) {
|
||||
gst_buffer_unref (*buf);
|
||||
}
|
||||
*buf = gst_buffer_new_and_alloc (got_size);
|
||||
gst_buffer_set_caps (*buf, sinkcaps);
|
||||
GST_BUFFER_OFFSET (*buf) = offset;
|
||||
|
@ -549,14 +552,20 @@ gst_base_transform_buffer_alloc (GstPad * pad, guint64 offset, guint size,
|
|||
not_configured:
|
||||
{
|
||||
/* let the default allocator handle it */
|
||||
*buf = NULL;
|
||||
if (*buf) {
|
||||
gst_buffer_unref (*buf);
|
||||
*buf = NULL;
|
||||
}
|
||||
gst_object_unref (trans);
|
||||
return GST_FLOW_OK;
|
||||
}
|
||||
unknown_size:
|
||||
{
|
||||
/* let the default allocator handle it */
|
||||
*buf = NULL;
|
||||
if (*buf) {
|
||||
gst_buffer_unref (*buf);
|
||||
*buf = NULL;
|
||||
}
|
||||
gst_object_unref (trans);
|
||||
return GST_FLOW_OK;
|
||||
}
|
||||
|
|
|
@ -535,6 +535,9 @@ gst_base_transform_buffer_alloc (GstPad * pad, guint64 offset, guint size,
|
|||
goto unknown_size;
|
||||
}
|
||||
|
||||
if (*buf) {
|
||||
gst_buffer_unref (*buf);
|
||||
}
|
||||
*buf = gst_buffer_new_and_alloc (got_size);
|
||||
gst_buffer_set_caps (*buf, sinkcaps);
|
||||
GST_BUFFER_OFFSET (*buf) = offset;
|
||||
|
@ -549,14 +552,20 @@ gst_base_transform_buffer_alloc (GstPad * pad, guint64 offset, guint size,
|
|||
not_configured:
|
||||
{
|
||||
/* let the default allocator handle it */
|
||||
*buf = NULL;
|
||||
if (*buf) {
|
||||
gst_buffer_unref (*buf);
|
||||
*buf = NULL;
|
||||
}
|
||||
gst_object_unref (trans);
|
||||
return GST_FLOW_OK;
|
||||
}
|
||||
unknown_size:
|
||||
{
|
||||
/* let the default allocator handle it */
|
||||
*buf = NULL;
|
||||
if (*buf) {
|
||||
gst_buffer_unref (*buf);
|
||||
*buf = NULL;
|
||||
}
|
||||
gst_object_unref (trans);
|
||||
return GST_FLOW_OK;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue