Bug 441122 - Toggling a gamut mask after it's deleted causes a segfault
Summary: Toggling a gamut mask after it's deleted causes a segfault
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Dockers (show other bugs)
Version: 4.4.7
Platform: Other Linux
: NOR crash
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-18 09:31 UTC by Michał Chojnowski
Modified: 2021-08-18 09:36 UTC (History)
0 users

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


Attachments
Bug reproduction video (408.53 KB, video/webm)
2021-08-18 09:31 UTC, Michał Chojnowski
Details

Note You need to log in before you can comment on or make changes to this bug.
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