mirror of
https://github.com/yshui/picom.git
synced 2024-11-11 13:51:02 -05:00
Fix NULL pointer deref in configure_root
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
parent
7b664de74e
commit
3ab4107fda
1 changed files with 3 additions and 4 deletions
|
@ -804,10 +804,9 @@ restack_win(session_t *ps, win *w, xcb_window_t new_above) {
|
|||
/// Handle configure event of a root window
|
||||
void configure_root(session_t *ps, int width, int height) {
|
||||
// On root window changes
|
||||
auto bi = backend_list[ps->o.backend];
|
||||
bool has_root_change = ps->backend_data->ops->root_change != NULL;
|
||||
if (ps->o.experimental_backends) {
|
||||
assert(bi);
|
||||
if (!ps->backend_data->ops->root_change) {
|
||||
if (!has_root_change) {
|
||||
// deinit/reinit backend if the backend cannot handle root change
|
||||
ps->backend_data->ops->deinit(ps->backend_data);
|
||||
ps->backend_data = NULL;
|
||||
|
@ -836,7 +835,7 @@ void configure_root(session_t *ps, int width, int height) {
|
|||
glx_on_root_change(ps);
|
||||
#endif
|
||||
if (ps->o.experimental_backends) {
|
||||
if (ps->backend_data->ops->root_change) {
|
||||
if (has_root_change) {
|
||||
ps->backend_data->ops->root_change(ps->backend_data, ps);
|
||||
} else {
|
||||
ps->backend_data = backend_list[ps->o.backend](ps);
|
||||
|
|
Loading…
Reference in a new issue