allocator: make a copy with the same alignment
authorWim Taymans <wim.taymans@collabora.co.uk>
Mon, 20 Aug 2012 09:31:51 +0000 (11:31 +0200)
committerWim Taymans <wim.taymans@collabora.co.uk>
Mon, 20 Aug 2012 09:31:51 +0000 (11:31 +0200)
When making a copy of the memory allocated from the default memory allocator,
make sure the new copy has the same alignment as the original memory.

See https://bugzilla.gnome.org/show_bug.cgi?id=680796

gst/gstallocator.c

index 2fbb2ed..df5b04f 100644 (file)
@@ -453,8 +453,8 @@ _default_mem_copy (GstMemoryDefault * mem, gssize offset, gsize size)
     size = mem->mem.size > offset ? mem->mem.size - offset : 0;
 
   copy =
-      _default_mem_new_block (0, mem->mem.maxsize, 0, mem->mem.offset + offset,
-      size);
+      _default_mem_new_block (0, mem->mem.maxsize, mem->mem.align,
+      mem->mem.offset + offset, size);
   GST_CAT_DEBUG (GST_CAT_PERFORMANCE,
       "memcpy %" G_GSIZE_FORMAT " memory %p -> %p", mem->mem.maxsize, mem,
       copy);