layer-shell: Avoid crash when surfaces width or height become negative
In case of negative width and height we removed a member from the list being iterated but didn't use the wl_list_for_each_reverse_safe variant for list iteration.
Doing so wouldn't solve the problem though since we invoke
arrange_layer
from handle_layer_shell_surface
. So we destroy
the object currently being constructed and all accesses to
wlr_layer_surface after that call to arrange_layer
become invalid.
In stead of that just skip the loop so the client gets aborted as the layer surface never gets configured.
The first patch is just the usual format cleanup (no functional change) as the function is at verge of a new style formatting block.
Edited by Guido Günther