Created attachment 157019 [details] short backtrace SUMMARY Title. On windows it also results in an unexpected behavior, as well as a crash (see Additional Info). STEPS TO REPRODUCE 1. Create a new paint layer A. 2. Add a blank* frame on A. 3. By holding Shift or Ctrl select several undefined keyframe slots** in the timeline of A. 4. Right click and choose "Clone Keyframes". 5. Create a new paint layer B, add a blank frame to it. 6. Right click on B's timeline and choose "Paste Keyframes"*** * whether or not the frames are blank does not impact the result ** the selection needs to contain at least one undefined frame and one other frame (defined or undefined) *** cloning by Alt+dragging does not result in a crash OBSERVED RESULT - krita crashes EXPECTED RESULT - krita doesn't crash - pasting undefined cloned frames has no impact - pasting an array of mixed defined and undefined cloned frames duplicates the defined frames, while undefined frames make no impact. SOFTWARE/OS VERSIONS Linux: Ubuntu 22.04 Qt Version: 5.12.12 ADDITIONAL INFORMATION The issue exists on Windows in a different form. When an undefined frame is cloned (and pasted) on B, it is replaced by a duplicate of the next defined frame in the timeline of A (the expected result is that pasting undefined frames shouldn't affect the timeline of B). If no such frame exists, Krita crashes.
Created attachment 157020 [details] long backtrace
Git commit 3712735fa2cb13fdde9ef5e61f24a817ff24df8b by Dmitry Kazakov. Committed on 18/04/2023 at 09:24. Pushed by dkazakov into branch 'master'. Make copy-frame utility function smore robust The code that calls them doesn't check if the source keyframe actually exists or not. M +8 -0 libs/image/kis_keyframe_channel.cpp https://invent.kde.org/graphics/krita/commit/3712735fa2cb13fdde9ef5e61f24a817ff24df8b