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.
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.
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