Bug 491665 - Crash when pasting content from clipboard after reopening Krita
Summary: Crash when pasting content from clipboard after reopening Krita
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: General (show other bugs)
Version: 5.2.3
Platform: Microsoft Windows Microsoft Windows
: NOR crash
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-08-13 13:08 UTC by aivanjou84
Modified: 2024-09-03 12:23 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description aivanjou84 2024-08-13 13:08:47 UTC
SUMMARY
Krita crashes when pasting content from the clipboard after reopening the program.

STEPS TO REPRODUCE
1. Copy bitmap content or any layer to the clipboard.
2. Close Krita.
3. Reopen Krita.
4. Paste the clipboard content.

OBSERVED RESULT
Krita crashes.

EXPECTED RESULT
Krita should paste the content correctly, or at least not crash if the content cannot be pasted.

SOFTWARE/OS VERSIONS
Windows: Windows 11 Pro

ADDITIONAL INFORMATION
·The crash occurs when copying and pasting any type of layer (vector layer, paint layer, filter layer, group layer).
·Copying vector elements and text works as long as the content of the layer is copied and not the layer itself.
·In the case of bitmap content, it crashes even if only a selection is copied and not the entire layer.
·If the content is copied from a reference image using the Reference Images Tool, the content will be pasted as a paint layer without any issues.
Comment 1 Freya Lupen 2024-08-13 13:45:20 UTC
Confirmed on 5.2.3. On 5.3.x it safe asserts and pastes an empty layer instead, because of commit 8ae307a9.

The reason it can't paste a layer from a previous run is because it doesn't store the layer data itself, but a pointer to it, which is no longer valid when Krita is closed.
Comment 2 Halla Rempt 2024-09-03 12:23:03 UTC
Git commit ad17230749bc1e73a9365f9c2939445f91718971 by Halla Rempt, on behalf of Simon Ra.
Committed on 03/09/2024 at 12:22.
Pushed by rempt into branch 'krita/5.2'.

fix an assert that should have been a safe assert.

This is hit when pasting data from a previous session of krita (after
restarting it) because the layer data itself is not on the clipboard.
(cherry picked from commit 8ae307a9d8dfebb039742089dcb5680e182df2f6)

M  +1    -1    libs/ui/kis_clipboard.cc

https://invent.kde.org/graphics/krita/-/commit/ad17230749bc1e73a9365f9c2939445f91718971