mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-18 05:16:05 +00:00
dmabuf: fix checking mmap flags
A simple '&' is not sufficiant. With mmapping_flags == PROT_READ and prot == PROT_READ|PROT_WRITE the check produces the wrong result. Change the check to make sure that prot is a subset of mmapping_flags. https://bugzilla.gnome.org/show_bug.cgi?id=730559
This commit is contained in:
parent
b444d8ba97
commit
42623c995e
1 changed files with 1 additions and 1 deletions
|
@ -97,7 +97,7 @@ 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) {
|
||||
if ((mem->mmapping_flags & prot) == prot) {
|
||||
ret = mem->data;
|
||||
mem->mmap_count++;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue