Bug 441122

Summary: Toggling a gamut mask after it's deleted causes a segfault
Product: [Applications] krita Reporter: Michał Chojnowski <michocho98+krita>
Component: DockersAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: crash    
Priority: NOR    
Version: 4.4.7   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Bug reproduction video

Description Michał Chojnowski 2021-08-18 09:31:43 UTC
Created attachment 140814 [details]
Bug reproduction video

SUMMARY

After deleting a gamut mask (or cancelling the creation of
a new gamut mask), using the gamut mask toggle button
in the gamut mask toolbar (available in circular artistic
color selectors) causes a segfault.

This is because the toolbar attempts to dereference a pointer to the
deleted gamut mask. This pointer should be nulled when the mask is
unset.

STEPS TO REPRODUCE
See the attached video.

OBSERVED RESULT
Segmentation fault.

EXPECTED RESULT
No crash.

SOFTWARE/OS VERSIONS
Irrelevant.
Comment 1 Bug Janitor Service 2021-08-18 09:34:18 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/1006
Comment 2 Halla Rempt 2021-08-18 09:36:32 UTC
Git commit 893b4bef8ae66d9f127a962441e0b08d0d09b7dc by Halla Rempt, on behalf of Michał Chojnowski.
Committed on 18/08/2021 at 09:36.
Pushed by rempt into branch 'krita/5.0'.

Fix a segfault in gamut mask toolbar

After deleting a gamut mask (or cancelling the creation of
a new gamut mask), using the gamut mask toggle button
in the gamut mask toolbar (available in circular artistic
color selectors) causes a segfault.

This is because the toolbar attempts to dereference a pointer to the
deleted gamut mask. This pointer should be nulled when the mask is
unset.
(cherry picked from commit 27fdf04dbc33719ac5d7df1ac86176bee3df807d)

M  +1    -0    libs/ui/widgets/KisGamutMaskToolbar.cpp

https://invent.kde.org/graphics/krita/commit/893b4bef8ae66d9f127a962441e0b08d0d09b7dc