Created attachment 133289 [details] Stack trace SUMMARY Krita can crash, when dragging an empty layer outside of main window, depending on what you're dragging it over. STEPS TO REPRODUCE 1. Create a new document 2. Create a new paint layer 3. Drag the empty paint layer over Plasma desktop / Visual Studio Code OBSERVED RESULT Crash EXPECTED RESULT No crash SOFTWARE/OS VERSIONS Linux: 5.9.8-arch1-1 KDE Plasma: 5.20.3 KDE Frameworks Version: 5.75.0 Qt Version: 5.15.1 ADDITIONAL INFORMATION Doesn't seem to affect Windows, couldn't reproduce there. Terminal output right before the crash: ``` libpng warning: Image width is zero in IHDR libpng warning: Image height is zero in IHDR libpng error: Invalid IHDR data Segmentation fault (core dumped) ```
Created attachment 133313 [details] gdb trace of Thread 1 Testing with the Nov 13 4.4.3 alpha (git 235939b) appimage on Debian 10 with the MATE desktop: I don't get a crash if I drag an empty layer from the Layers docker over anywhere, including the desktop and floating dockers, then put it back on the Layers docker. If I drag a layer with content onto the workspace/canvas, it duplicates the layer and gives it the same name. Drag/dropping it anywhere else has no effect. Drag/dropping an empty layer onto the workspace/canvas gives a crash. I attach a gdb thread listing. Setting to Confirmed
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/619
Git commit 11a8010dd4713aea1482d98b1b0beec6e672388b by Lucid Sunlight. Committed on 18/12/2020 at 13:59. Pushed by dkazakov into branch 'master'. Don't build .kra file if image is empty Happens when drag&dropping empty layers. Can cause modulo by zero crash in `KisDocument::generatePreview` when dragging onto canvas, or somewhere in QuaZip when dragging outside of Krita. M +4 -0 plugins/impex/kra/kra_converter.cpp https://invent.kde.org/graphics/krita/commit/11a8010dd4713aea1482d98b1b0beec6e672388b
Git commit f55654f84a751a2f8433a016998f34cb8f7c88f5 by Lucid Sunlight, on behalf of Dmitry Kazakov. Committed on 18/12/2020 at 14:02. Pushed by dkazakov into branch 'master'. Default to image bounds if nodes are empty Prevents creating an invalid image. M +4 -0 libs/ui/kis_mimedata.cpp https://invent.kde.org/graphics/krita/commit/f55654f84a751a2f8433a016998f34cb8f7c88f5
Git commit e5a71530fc4d38fa10904765a1e451ff694cffe0 by Dmitry Kazakov, on behalf of Lucid Sunlight. Committed on 19/12/2020 at 10:47. Pushed by dkazakov into branch 'krita/4.3'. Don't build .kra file if image is empty Happens when drag&dropping empty layers. Can cause modulo by zero crash in `KisDocument::generatePreview` when dragging onto canvas, or somewhere in QuaZip when dragging outside of Krita. M +4 -0 plugins/impex/kra/kra_converter.cpp https://invent.kde.org/graphics/krita/commit/e5a71530fc4d38fa10904765a1e451ff694cffe0
Git commit 5bc380c6f23e209e8543af17cc94dd8e1cc03282 by Dmitry Kazakov. Committed on 19/12/2020 at 10:48. Pushed by dkazakov into branch 'krita/4.3'. Default to image bounds if nodes are empty Prevents creating an invalid image. M +4 -0 libs/ui/kis_mimedata.cpp https://invent.kde.org/graphics/krita/commit/5bc380c6f23e209e8543af17cc94dd8e1cc03282
Git commit 6659bb5099241657310f0a88417988c44f8b058b by Dmitry Kazakov, on behalf of Lucid Sunlight. Committed on 19/12/2020 at 10:50. Pushed by dkazakov into branch 'krita/4.4.2'. Don't build .kra file if image is empty Happens when drag&dropping empty layers. Can cause modulo by zero crash in `KisDocument::generatePreview` when dragging onto canvas, or somewhere in QuaZip when dragging outside of Krita. M +4 -0 plugins/impex/kra/kra_converter.cpp https://invent.kde.org/graphics/krita/commit/6659bb5099241657310f0a88417988c44f8b058b
Git commit 4c73e176f847fae9ac945ef8a7bedef282c07c0a by Dmitry Kazakov. Committed on 19/12/2020 at 10:50. Pushed by dkazakov into branch 'krita/4.4.2'. Default to image bounds if nodes are empty Prevents creating an invalid image. M +4 -0 libs/ui/kis_mimedata.cpp https://invent.kde.org/graphics/krita/commit/4c73e176f847fae9ac945ef8a7bedef282c07c0a