mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 02:01:12 +00:00
Move newbuf creation to the non-copyfunc case, since the copyfunc is now assumed to create the buffer (from a bufferp...
Original commit message from CVS: Move newbuf creation to the non-copyfunc case, since the copyfunc is now assumed to create the buffer (from a bufferpool, perhaps). This solves a memory leak.
This commit is contained in:
parent
8b29840f55
commit
557b4281ce
1 changed files with 3 additions and 3 deletions
|
@ -352,13 +352,13 @@ gst_buffer_copy (GstBuffer *buffer)
|
|||
{
|
||||
GstBuffer *newbuf;
|
||||
|
||||
// allocate a new buffer
|
||||
newbuf = gst_buffer_new();
|
||||
|
||||
// if a copy function exists, use it, else copy the bytes
|
||||
if (buffer->copy != NULL) {
|
||||
newbuf = (buffer->copy)(buffer);
|
||||
} else {
|
||||
// allocate a new buffer
|
||||
newbuf = gst_buffer_new();
|
||||
|
||||
// copy the absolute size
|
||||
newbuf->size = buffer->size;
|
||||
// allocate space for the copy
|
||||
|
|
Loading…
Reference in a new issue