summaryrefslogtreecommitdiffstats
path: root/wscript_build.py
diff options
context:
space:
mode:
authorSven Kroeger <svenni.kroeger@gmail.com>2020-03-04 12:48:40 +0100
committerwm4 <1387750+wm4@users.noreply.github.com>2020-03-05 18:12:57 +0100
commitfc8c1fcfb2b66d3a05f6d94f8dfffac34207900c (patch)
tree54d881b56897287744863742c9998a7dd5932769 /wscript_build.py
parent8b24510388c7af223ecdfd8ebe242be315424eaf (diff)
downloadmpv-fc8c1fcfb2b66d3a05f6d94f8dfffac34207900c.tar.bz2
mpv-fc8c1fcfb2b66d3a05f6d94f8dfffac34207900c.tar.xz
drm_prime: double free bug
This commit fixes a bug where handle for a framebuffer gets double freed. It seems to happen that the same prime fd gets two framebuffers. As the prime fd is the same the resulting prime handle is also the same. This means one handle but 2 framebuffers and can lead to the following chain: 1. The first framebuffer gets deleted the handle gets also freed via the ioctl. 2. In startup phase not all 4 dumb buffers for overlay drawing are set up. It can happen that the last dumb buffer gets the handle we freed above. 3. The second framebuffer gets freed and the handle will be freed again resulting that the 4's dumb buffer handle is not backed by a buffer. 4. Drm prime continues to assign handles to its prime fds an will lead to have this handle which was just freed to reassign again but to an prime buffer. 5.Now the overlay should be drawn into dumb buffer 4 which still has the same handle but is backed by the wrong buffer. This leads to two different behaviors: - MPV crashes as the drm prime buffers size als calculated by the decoder output format. The overlay output format differs and it takes more space. SO the size check in kernel fails. - MPV is continuing play. This happens when the decoders allocates a bigger buffer than needed for the overlay. For example overlay is Full HD and decoder output is 4k. This leads to the behavior das the overlay wil be drawn into the wrong buffer as its a drm prime buffer and results in a flicker every fourth step.
Diffstat (limited to 'wscript_build.py')
0 files changed, 0 insertions, 0 deletions