Ensure, that the resulting surface size is at least 1x1, even when
destination size is not set and source size is zero. Previously this
lead to zero surface size.
This can still happen due to wl_viewport.set(#, #, 0, 0, #, #) followed
by wl_viewport.set_destination(-1, -1).
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
}
if (vp->buffer.src_width != wl_fixed_from_int(-1)) {
- surface_set_size(surface,
- fixed_round_up_to_int(vp->buffer.src_width),
- fixed_round_up_to_int(vp->buffer.src_height));
+ int32_t w = fixed_round_up_to_int(vp->buffer.src_width);
+ int32_t h = fixed_round_up_to_int(vp->buffer.src_height);
+
+ surface_set_size(surface, w ?: 1, h ?: 1);
return;
}