[PATCH xserver] xwayland: avoid a crash with empty window pixmaps

Olivier Fourdan ofourdan at redhat.com
Wed Jan 24 10:36:29 UTC 2018


Hi Adam,

On Tue, Jan 23, 2018 at 6:41 PM, Adam Jackson <ajax at nwnk.net> wrote:

>
> Map / draw / unmap without hitting BlockHandler? I think
> xwl_unrealize_window() might be broken for that case:
>
>     /* ... */
>     wl_surface_destroy(xwl_window->surface);
>     if (RegionNotEmpty(DamageRegion(xwl_window->damage)))
>         xorg_list_del(&xwl_window->link_damage);
>     DamageUnregister(xwl_window->damage);
>     DamageDestroy(xwl_window->damage);
>     /* ... */
>
> If (for whatever reason) the damage region wasn't empty, we'd never
>

You mean “was empty” here, right, or do I misunderstand?

(we unlink if RegionNotEmpty() so we don't unlink if the region is empty)


> unlink this window from the dirty list. Should probably just unlink it
> unconditionally. If this is indeed what's happening, then the window
> being updated in xwl_window_post_damage() would have ->mapped = 0, and
> would be not the root window itself.
>

So basically, just remove the  “if
(RegionNotEmpty(DamageRegion(xwl_window->damage)))”
would suffice?

Cheers,
Olivier
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.x.org/archives/xorg-devel/attachments/20180124/a9a7bebd/attachment-0001.html>


More information about the xorg-devel mailing list