Skip to content

Commit

Permalink
Don't build .kra file if image is empty
Browse files Browse the repository at this point in the history
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.

BUG:429049
  • Loading branch information
awaken1ng committed Dec 18, 2020
1 parent d3d84d3 commit 11a8010
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions plugins/impex/kra/kra_converter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ QVector<StoryboardComment> KraConverter::storyboardCommentList()

KisImportExportErrorCode KraConverter::buildFile(QIODevice *io, const QString &filename)
{
if (m_image->size().isEmpty()) {
return ImportExportCodes::Failure;
}

setProgress(5);
m_store = KoStore::createStore(io, KoStore::Write, m_doc->nativeFormatMimeType(), KoStore::Zip);

Expand Down

0 comments on commit 11a8010

Please sign in to comment.