Bug 412804

Summary: Crash when using the Magnetic Selection Tool
Product: [Applications] krita Reporter: M <manuel.snudl.zeidler>
Component: Tools/SelectionAssignee: Kuntal Majumder <hellozee>
Status: RESOLVED FIXED    
Severity: normal CC: hellozee
Priority: NOR    
Version First Reported In: git master (please specify the git hash!)   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Test file
gdb backtrace

Description M 2019-10-10 08:49:04 UTC
Created attachment 123119 [details]
Test file

SUMMARY
The Magnetic Selection Tool can crash immediately after setting a control point with the attached test file.

STEPS TO REPRODUCE
1. Open the test file and choose the the Magnetic Selection Tool
2. Set the initial control point close to the beginning of the stroke in the bottom left

OBSERVED RESULT
Freeze and crash after trying to place a control point. Depending on where the first control point is set it can happen immediately when placing the first one, or later on. See the attached backtrace.

EXPECTED RESULT
Normal tool operation.

SOFTWARE/OS VERSIONS
Tested in build from master (git c870d77)
Comment 1 M 2019-10-10 08:49:54 UTC
Created attachment 123120 [details]
gdb backtrace
Comment 2 M 2019-10-10 08:57:21 UTC
Oh, I should add I left all the default values in the tool options.
Comment 3 Kuntal Majumder 2019-10-10 09:01:16 UTC
Not required, I got the problem, :)
Comment 4 Kuntal Majumder 2019-10-10 10:27:38 UTC
Git commit 9df578ddb13c9f4235a0bbd318407fa69a5e6716 by Kuntal Majumder.
Committed on 10/10/2019 at 10:27.
Pushed by kuntalmajumder into branch 'master'.

Checks the bounds before proceeding for calculating the edge

M  +10   -4    plugins/tools/selectiontools/KisMagneticWorker.cc
M  +15   -5    plugins/tools/selectiontools/KisToolSelectMagnetic.cc

https://invent.kde.org/kde/krita/commit/9df578ddb13c9f4235a0bbd318407fa69a5e6716
Comment 5 Kuntal Majumder 2019-10-10 16:37:57 UTC
Git commit 6310d2d7ad293f20a758ac80b84d95a90fa6c06b by Kuntal Majumder.
Committed on 10/10/2019 at 16:37.
Pushed by kuntalmajumder into branch 'master'.

Switched exactBounds with defaultBounds for calculating the right number
of tiles

M  +4    -12   plugins/tools/selectiontools/KisMagneticWorker.cc

https://invent.kde.org/kde/krita/commit/6310d2d7ad293f20a758ac80b84d95a90fa6c06b