mpv/video/out
Dudemanguy 5512f53722 player: fix autofit/geometry related segfault
Back when runtime updating of autofit/geometry was added for wayland and
x11 (commits: 4445ac828d and
ced92ba607 respectively), the naive
assumption was that window-related geometry would always be available.
While this is true 99% of the time, this isn't a guarentee. It is
possible for certain things such as loading shaders to delay starting up
the player. This causes autofit/geometry options to be registered as a
runtime update and triggers VOCTRL_VO_OPTS_CHANGED. This ends up calling
some geometry-related functions but this happens before the actual
values are available. Hence, a nullptr was accessed which segfaults. At
least one user experienced this with a combination of options in wayland
but in theory the same thing could happen under x11.

The fix is simple. Just be sure to check that the required geometry is
available before doing any calculations. In wayland, this would be
wl->current_output. Additionally add an assert to set_geometry (we
should never use this function without wl->current_output) to be extra
sure. In x11, the check is on x11->window. Later when the reconfig for
each backend actually happens, the autofit/geometry set by the user
happens anyway so ignoring it in this case does no harm. Fixes #9381.
2021-11-03 00:32:27 +00:00
..
cocoa cocoa_common: remove deprecated VOCTRLs/VO_EVENTs 2019-12-12 19:56:03 +01:00
d3d11 options: Make validation and help possible for all option types 2021-03-28 19:46:27 +03:00
gpu vo_gpu: fix rotated compute shader vertex simulation 2021-10-22 19:08:13 +02:00
hwdec vo_gpu: libplacebo: drop conditional code paths for old versions 2021-10-04 12:09:58 +02:00
mac mac: add support for display-width/display-height property 2021-05-06 17:36:55 +00:00
opengl drm_common: enable specific device selection by means of path 2021-10-25 20:37:03 +02:00
placebo vo_gpu: libplacebo: simplify tex transfers for libplacebo 168+ 2021-10-31 19:39:58 +01:00
vulkan vo_gpu: libplacebo: drop conditional code paths for old versions 2021-10-04 12:09:58 +02:00
win32
android_common.c options: simplify --android-surface-size handling 2020-09-20 12:04:25 +02:00
android_common.h
aspect.c options: add --video-scale-x/y 2020-06-03 17:26:44 +02:00
aspect.h
bitmap_packer.c
bitmap_packer.h
cocoa_cb_common.swift mac: fix traditional fullscreen on macOS 11 2021-02-27 13:12:46 +01:00
cocoa_common.h
cocoa_common.m build: change filenames of generated files 2020-06-04 16:59:05 +02:00
dither.c
dither.h
dr_helper.c
dr_helper.h
drm_atomic.c vo_drm: fix typo in error message 2021-08-26 20:35:13 +03:00
drm_atomic.h
drm_common.c drm_common: add connector types USB, SPI and Writeback 2021-10-26 17:44:54 +00:00
drm_common.h drm_common: enable specific device selection by means of path 2021-10-25 20:37:03 +02:00
drm_prime.c drm_prime: fallback to drmModeAddFB2 2020-05-08 21:26:25 +02:00
drm_prime.h drm_prime: double free bug 2020-03-05 18:12:57 +01:00
filter_kernels.c filter_kernels: fix quadric window 2021-05-04 13:18:43 +02:00
filter_kernels.h
libmpv.h client API: add software rendering API 2020-07-08 22:42:05 +02:00
libmpv_sw.c client API: add software rendering API 2020-07-08 22:42:05 +02:00
vo.c video/out/vo_sixel.c: Implement sixel as a output device 2020-11-07 18:51:49 +02:00
vo.h command: add display-width/display-height property 2021-05-06 17:36:55 +00:00
vo_caca.c
vo_direct3d.c vo_direct3d: dumb down OSD rendering 2020-05-13 23:16:32 +02:00
vo_drm.c drm_common: enable specific device selection by means of path 2021-10-25 20:37:03 +02:00
vo_gpu.c vo_gpu: fix trivial memory leak 2021-05-07 15:01:15 +02:00
vo_image.c options: change option macros and all option declarations 2020-03-18 19:52:01 +01:00
vo_lavc.c
vo_libmpv.c client API: add software rendering API 2020-07-08 22:42:05 +02:00
vo_mediacodec_embed.c
vo_null.c options: change option macros and all option declarations 2020-03-18 19:52:01 +01:00
vo_rpi.c vo_rpi: fix DISPMANX_UPDATE_HANDLE_T leak 2021-09-28 16:46:52 +00:00
vo_sdl.c options: change option macros and all option declarations 2020-03-18 19:52:01 +01:00
vo_sixel.c vo_sixel: don't divide by zero on small terminal 2020-12-02 17:06:11 +02:00
vo_tct.c vo_tct: add resize capability 2021-08-26 11:29:07 -07:00
vo_vaapi.c draw_bmp: use command line options for any used scalers 2020-05-13 20:07:59 +02:00
vo_vdpau.c vo_vdpau: Don't treat preemption as an error when reconfiguring 2021-08-12 11:14:37 -07:00
vo_wlshm.c vo_wlshm: remove empty options struct 2021-08-09 16:39:08 -05:00
vo_x11.c vo_x11: partially restore operation on bad endian systems 2020-06-17 19:44:50 +02:00
vo_xv.c options: change option macros and all option declarations 2020-03-18 19:52:01 +01:00
w32_common.c win32: initial position: center with borders 2021-09-06 10:16:10 +03:00
w32_common.h
wayland_common.c player: fix autofit/geometry related segfault 2021-11-03 00:32:27 +00:00
wayland_common.h wayland: further xdg-decoration/border refinements 2021-09-28 16:54:09 +00:00
win_state.c win_state: add vo_calc_window_geometry3 2021-09-06 10:16:10 +03:00
win_state.h win_state: add vo_calc_window_geometry3 2021-09-06 10:16:10 +03:00
x11_common.c player: fix autofit/geometry related segfault 2021-11-03 00:32:27 +00:00
x11_common.h x11: update geometry/autofit opts on runtime 2020-12-14 22:44:05 +00:00