Bug 455241 - Crash after assigning "one finger drag" to zoom and rotate canvas
Summary: Crash after assigning "one finger drag" to zoom and rotate canvas
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Unclassified
Component: Shortcuts and Canvas Input Settings (show other bugs)
Version: nightly build (please specify the git hash!)
Platform: Microsoft Windows Microsoft Windows
: NOR crash
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-06-14 11:08 UTC by Alvin Wong
Modified: 2022-06-24 09:10 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
crash backtrace (4.23 KB, text/plain)
2022-06-14 11:08 UTC, Alvin Wong
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alvin Wong 2022-06-14 11:08:57 UTC
Created attachment 149674 [details]
crash backtrace

SUMMARY



STEPS TO REPRODUCE
1. Assign "One Finger Drag" gesture to "Zoom and Rotate Canvas" (Discrete Rotate Mode) in Canvas Input Settings
2. Perform one finger drag gesture on canvas

OBSERVED RESULT
Crash

EXPECTED RESULT
At least it shouldn't crash

SOFTWARE/OS VERSIONS
Windows: Windows 10
Comment 1 Halla Rempt 2022-06-15 09:02:42 UTC
Since the KisZoomAndRotate::inputEvent hardcodes for two touch points, it's logical that there'll be a crash if there's only one of them:

        const QPointF p0 = tevent->touchPoints().at(0).pos();
        const QPointF p1 = tevent->touchPoints().at(1).pos();

I'm not sure what we should do here, ignore the event if there's only one touchpoint or make sure this setting is impossible.
Comment 2 Halla Rempt 2022-06-24 09:10:11 UTC
Git commit 0a3a0148c9b107668e378b4113bbaae28df871ce by Halla Rempt.
Committed on 24/06/2022 at 09:09.
Pushed by rempt into branch 'master'.

Check the size of the touchpoints array before indexing

M  +20   -18   libs/ui/input/kis_zoom_and_rotate_action.cpp

https://invent.kde.org/graphics/krita/commit/0a3a0148c9b107668e378b4113bbaae28df871ce
Comment 3 Halla Rempt 2022-06-24 09:10:26 UTC
Git commit 85faf731616931baed7ec48ccfb84a266d96a625 by Halla Rempt.
Committed on 24/06/2022 at 09:10.
Pushed by rempt into branch 'krita/5.1'.

Check the size of the touchpoints array before indexing
(cherry picked from commit 0a3a0148c9b107668e378b4113bbaae28df871ce)

M  +20   -18   libs/ui/input/kis_zoom_and_rotate_action.cpp

https://invent.kde.org/graphics/krita/commit/85faf731616931baed7ec48ccfb84a266d96a625