buffer: don't clear TAG on NULL buffer
authorWim Taymans <wtaymans@redhat.com>
Mon, 24 Mar 2014 15:11:30 +0000 (16:11 +0100)
committerWim Taymans <wtaymans@redhat.com>
Mon, 24 Mar 2014 15:11:30 +0000 (16:11 +0100)
When the buffer fails to copy, don't clear the TAG on the NULL pointer.

gst/gstbuffer.c

index 008ce6a..019261e 100644 (file)
@@ -519,7 +519,8 @@ _gst_buffer_copy (GstBuffer * buffer)
   if (!gst_buffer_copy_into (copy, buffer, GST_BUFFER_COPY_ALL, 0, -1))
     gst_buffer_replace (&copy, NULL);
 
-  GST_BUFFER_FLAG_UNSET (copy, GST_BUFFER_FLAG_TAG_MEMORY);
+  if (copy)
+    GST_BUFFER_FLAG_UNSET (copy, GST_BUFFER_FLAG_TAG_MEMORY);
 
   return copy;
 }