mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-18 07:47:17 +00:00
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
This commit is contained in:
parent
48b8e61334
commit
3c66c2a43d
1 changed files with 3 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue