Don't call elapsed() on an invalid QElapsedTimer


It's UB, and it returns garbage.

In QWaylandWindow::timerEvent the value was unused
if the timer was invalid (but that was tested only later).

In QWaylandInputDevice / QWaylandTabletToolV2 however the
garbage value was passed on to wl_cursor_frame_and_duration.

Testcase: running tests/auto/client/client/tst_client
and tests/auto/client/tabletv2/tst_tabletv2 in a UBSAN build.

Pick-to: 6.9 6.8 6.5
Change-Id: Ie0f8610bbca49913942b2247d3e968197e12f47e
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
commitb8f62228b204d1009bbe3187032f3dd2c91216d1
parent07254e34c0ffb1c8e590f5cfda6779e7451832cf
authorDavid Faure <david.faure@kdab.com>
committerDavid Faure <david.faure@kdab.com>
commit timeSat, 5 Apr 2025 12:48:05 +0100