mpv/video/out/opengl
Sven Kroeger fc8c1fcfb2 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.
2020-03-05 18:12:57 +01:00
..
angle_dynamic.c
angle_dynamic.h
common.c OpenGL: Also detect softpipe as a software driver 2020-02-25 21:32:04 +02:00
common.h
context.c vo_gpu/opengl: fully initialize FBO when passing it to rendering 2019-10-30 15:54:41 +01:00
context.h vo: use a struct for vsync feedback stuff 2018-12-06 10:30:25 +01:00
context_android.c context_android: move common code to a separate file 2019-09-27 00:05:06 +03:00
context_angle.c vo: make swapchain-depth option generic for all VOs 2019-09-28 14:10:01 +03:00
context_cocoa.c cocoa-cb: add support for forcing the dedicated GPU for rendering 2020-01-26 12:12:22 +01:00
context_drm_egl.c drm: avoid division by 0 in drm_pflip_cb with bad drivers 2019-12-07 18:34:25 +01:00
context_dxinterop.c vo: make swapchain-depth option generic for all VOs 2019-09-28 14:10:01 +03:00
context_glx.c vo_gpu: context_glx: Add X11 native resource 2019-11-16 15:35:32 -08:00
context_rpi.c rpi: destroy fullscreen change handling 2019-12-11 18:50:37 +01:00
context_wayland.c wayland: remove wayland-frame-wait-offset option 2020-01-31 00:40:44 +00:00
context_win.c
context_x11egl.c vo_gpu: opengl: make it work with EGL 1.4 2019-12-16 00:25:51 +01:00
egl_helpers.c vo_gpu: opengl: make it work with EGL 1.4 2019-12-16 00:25:51 +01:00
egl_helpers.h vo_gpu: opengl: make it work with EGL 1.4 2019-12-16 00:25:51 +01:00
formats.c
formats.h
gl_headers.h vo_gpu: opengl: add hack for ancient Mesa/GLX 2019-11-30 13:38:28 +01:00
hwdec_d3d11egl.c vo_gpu: hwdec_d3d11egl: add missing P010 format to supported list 2019-10-17 22:45:05 +02:00
hwdec_drmprime_drm.c drm_prime: double free bug 2020-03-05 18:12:57 +01:00
hwdec_dxva2egl.c
hwdec_dxva2gldx.c
hwdec_ios.m hwdec_ios: fix crash after mapper_init failure 2018-04-17 01:06:29 +03:00
hwdec_osx.c
hwdec_rpi.c
hwdec_vdpau.c vo_gpu: hwdec_vdpau: remove direct_mode 2019-12-28 14:31:06 -08:00
libmpv_gl.c
oml_sync.c oml_sync: fix typo in comment 2019-09-20 00:32:29 +02:00
oml_sync.h vo_gpu: glx: move OML sync code to an independent file 2019-09-08 23:23:43 +10:00
ra_gl.c vo_gpu: opengl: add support for IMGFMT_RGB30 2019-11-02 17:46:46 +01:00
ra_gl.h
utils.c
utils.h