Commit 3c66c2a4 authored by Michael Olbrich's avatar Michael Olbrich Committed by Sebastian Dröge
Browse files

dmabuf: fix mmap counting

A successful gst_dmabuf_mem_map must always increment the mmap count.
Otherwise the first gst_dmabuf_mem_unmap will unmap the memory and all
other user will access unmapped memory.

https://bugzilla.gnome.org/show_bug.cgi?id=706680
parent 48b8e613
......@@ -90,8 +90,10 @@ gst_dmabuf_mem_map (GstMemory * gmem, gsize maxsize, GstMapFlags flags)
if (mem->data) {
/* only return address if mapping flags are a subset
* of the previous flags */
if ((mem->mmapping_flags & prot) && (mem->mmap_size >= maxsize))
if ((mem->mmapping_flags & prot) && (mem->mmap_size >= maxsize)) {
ret = mem->data;
mem->mmap_count++;
}
goto out;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment