mpv/video
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
..
decode Remove remains of Libav compatibility 2020-02-16 15:14:55 +01:00
filter vf_format: add w, h parameters 2020-02-09 18:23:22 +01:00
out drm_prime: double free bug 2020-03-05 18:12:57 +01:00
csputils.c
csputils.h
cuda.c video: cuda: add explicit context creation for copy hwaccels 2019-12-29 14:32:47 -08:00
d3d.c
d3d.h
fmt-conversion.c video: drop NV24 alias 2020-02-18 18:03:42 +01:00
fmt-conversion.h
hwdec.c video: cuda: add explicit context creation for copy hwaccels 2019-12-29 14:32:47 -08:00
hwdec.h video: cuda: add explicit context creation for copy hwaccels 2019-12-29 14:32:47 -08:00
image_loader.c
image_loader.h
image_writer.c
image_writer.h
img_format.c Remove remains of Libav compatibility 2020-02-16 15:14:55 +01:00
img_format.h video: drop NV24 alias 2020-02-18 18:03:42 +01:00
mp_image.c Remove remains of Libav compatibility 2020-02-16 15:14:55 +01:00
mp_image.h
mp_image_pool.c
mp_image_pool.h
sws_utils.c Remove remains of Libav compatibility 2020-02-16 15:14:55 +01:00
sws_utils.h sws_utils, zimg: destroy vo_x11 and vo_drm performance 2019-10-31 16:51:12 +01:00
vaapi.c vaapi: reduce log levels further 2020-01-11 16:35:30 +01:00
vaapi.h
vdpau.c
vdpau.h
vdpau_functions.inc
vdpau_mixer.c
vdpau_mixer.h
zimg.c zimg: fix previous odd sizes commit 2020-02-13 01:26:51 +01:00
zimg.h sws_utils, zimg: destroy vo_x11 and vo_drm performance 2019-10-31 16:51:12 +01:00