Bug 424468 - Crash if Spray Brush Brush Tip Ratio=0
Summary: Crash if Spray Brush Brush Tip Ratio=0
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Brush engines (show other bugs)
Version: nightly build (please specify the git hash!)
Platform: Appimage Linux
: NOR crash
Target Milestone: ---
Assignee: vanyossi
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-07-20 14:17 UTC by Sebastian
Modified: 2020-07-25 00:46 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Contains the system information, the usage log and a screen capture (2.29 MB, application/zip)
2020-07-20 14:17 UTC, Sebastian
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian 2020-07-20 14:17:49 UTC
Created attachment 130285 [details]
Contains the system information, the usage log and a screen capture

SUMMARY
Krita crashes if Brush Tip of a Spray Brush is set to Auto, Mask Type to Soft and Ratio to 0

STEPS TO REPRODUCE
1. Create/open any document
2. Select a Spray engine Brush
3. Open the Edit brush settings panel and go to Brush Tip
4. Set the Brush tip to Auto
5. Set Mask Type to Soft
6. Set Ratio to 0

OBSERVED RESULT
Krita crashes

EXPECTED RESULT
Brush Tip Ratio is set to 0, Brush tip becomes invisible

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: Kubuntu 20.04
(available in About System)
KDE Plasma Version: 5.18.5
KDE Frameworks Version: 5.68.0
Qt Version: 5.12.8
Krita Version: 5.0.0-prealpha (git 7962e6a) Appimage

ADDITIONAL INFORMATION
Drawing Tablet: Wacom Intuos Art Medium


I tried to make a Backtrace, but this is apparently impossible with the appimage.
This is the first time I report a bug. Please let me know if something is missing or if I there is anything else I can do.
Comment 1 Ahab Greybeard 2020-07-20 14:53:51 UTC
I can confirm this for appimages 4.2.0 to 4.3.0.

When using a Spray Engine brush preset, every painted stroke creates the following terminal output line:
QFSFileEngine::open: No file name specified

When the Ratio is set to zero, as described, there is a crash with:
Segmentation Fault
as the only terminal output.
Comment 2 Sebastian 2020-07-21 10:11:08 UTC
I did some more testing and I found out that the crash can be reproduced with every brush engine that has the Brush Tip option.
These engines are affected:
• Spray 
• Pixel
• Color smudge
• Sketch
• Bristle
• Hatching
• Clone
• Tangent normal
• Filter
Comment 3 vanyossi 2020-07-25 00:46:43 UTC
Git commit 6a43b23c38e04a4d4faec38ec264b7d06a914abe by Ivan Yossi.
Committed on 25/07/2020 at 00:45.
Pushed by ivany into branch 'master'.

Fix crash if soft brush ratio is zero

on linux ratio with size 0 caused Vc to generate incorrect indexes for
the curve lookout values. This is now shielded from the GUI 
limiting min ratio values to 0.01

Also values below 0 are masked out in Vc to avoid other similar crashes

M  +3    -0    libs/image/kis_brush_mask_applicator_factories.cpp
M  +1    -1    plugins/paintops/libpaintop/kis_auto_brush_widget.cpp

https://invent.kde.org/graphics/krita/commit/6a43b23c38e04a4d4faec38ec264b7d06a914abe