diff options
author | Dudemanguy <random342@airmail.cc> | 2021-11-20 10:48:09 -0600 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2021-12-19 15:58:12 +0100 |
commit | f2bc9e4dd112ac58f1178515e85fdef1cda78eff (patch) | |
tree | 82ac9e5284736d68ae05091683d4c98e228bf6e5 /video/out/opengl/angle_dynamic.c | |
parent | f8b85dd65d18c0c211a97fadee26fbcbc9e36e2e (diff) | |
download | mpv-f2bc9e4dd112ac58f1178515e85fdef1cda78eff.tar.bz2 mpv-f2bc9e4dd112ac58f1178515e85fdef1cda78eff.tar.xz |
wayland: fix a potential segfault on surface enter
This possibility actually existed for years. The wayland protocol is
asynchronous and there's no restriction on when a compositor can send a
surface enter event. In mpv's case, the surface enter event is used to
set some vital things regarded geometry/scaling etc. However, this
implictly assumes that wl->current_output is actually initialized. The
vast majority of the time, vo_wayland_reconfig will happen first which
is where wl->current_output is, and should, be created. There's no
rule/law that the ordering of events will always occur in this order.
Plasma with certain auto-profile conditions can send the surface enter
event before mpv does its initial reconfig. That segfaults of course.
Just add a check to make sure we have wl->current_output here and return
if we don't. This assumes that the compositor will send us another
surface enterance event when mpv actually does the initial surface
commit and roundtrip request later. Wayland logs indicate this does
happen. Fixes #9492.
Diffstat (limited to 'video/out/opengl/angle_dynamic.c')
0 files changed, 0 insertions, 0 deletions