After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 671126 - v4l2src: call munmap() with same length as mmap()
v4l2src: call munmap() with same length as mmap()
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: 0.10.32
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-03-01 13:25 UTC by Oleksij Rempel
Modified: 2012-03-03 13:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
v4l2src: patch v1 (2.50 KB, patch)
2012-03-01 13:25 UTC, Oleksij Rempel
committed Details | Review

Description Oleksij Rempel 2012-03-01 13:25:43 UTC
Created attachment 208781 [details] [review]
v4l2src: patch v1

current v4l2src use same structure for VIDIOC_QUERYBUF, VIDIOC_QBUF
aand v4l2_munmap calls. The problem, video buffer size (lenght) may variate for
compressed or emulated bufs. VIDIOC_QBUF will change it if we pass
the pointer of v4l2_buffer pointer.
This is why we should avoid using same variable for mmap and video buffers.
Comment 1 Tim-Philipp Müller 2012-03-03 13:08:46 UTC
Pushed, thanks!

 commit 4cd9255f0a8a9e15d81561f00f02d275b5095f70
 Author: Oleksij Rempel (Alexey Fisher) <bug-track@fisher-privat.net>
 Date:   Thu Mar 1 14:15:29 2012 +0100

    v4l2src: fix v4l2_munmap() for compressed formats
    
    Make sure we always call munmap() with the same size we called mmap()
    with before.
    
    Current v4l2src uses the same structure for VIDIOC_QUERYBUF, VIDIOC_QBUF
    and v4l2_munmap calls. The problem is that the video buffer size (length)
    may vary for compressed or emulated bufs. VIDIOC_QBUF will change it if
    we pass the pointer of a v4l2_buffer. This is why we should avoid using
    same variable for mmap and video buffers.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=671126