diff --git a/src/app/valentina/mainwindowsnogui.cpp b/src/app/valentina/mainwindowsnogui.cpp index ce764ac6f..426c1288c 100644 --- a/src/app/valentina/mainwindowsnogui.cpp +++ b/src/app/valentina/mainwindowsnogui.cpp @@ -795,9 +795,11 @@ void MainWindowsNoGUI::DxfFile(const QString &name, int i) const } QPainter painter; - painter.begin(&generator); - scenes.at(i)->render(&painter, paper->rect(), paper->rect(), Qt::IgnoreAspectRatio); - painter.end(); + if (painter.begin(&generator)) + { + scenes.at(i)->render(&painter, paper->rect(), paper->rect(), Qt::IgnoreAspectRatio); + painter.end(); + } } } diff --git a/src/libs/vdxf/dxflib/dl_dxf.cpp b/src/libs/vdxf/dxflib/dl_dxf.cpp index 80ff93356..c4cf29ed4 100644 --- a/src/libs/vdxf/dxflib/dl_dxf.cpp +++ b/src/libs/vdxf/dxflib/dl_dxf.cpp @@ -2549,8 +2549,9 @@ void DL_Dxf::endSequence(DL_CreationInterface* creationInterface) */ DL_WriterA* DL_Dxf::out(const char* file, DL_Codes::version version) { - char* f = new char[strlen(file)+1]; - strlcpy(f, file, sizeof(f)); + const int size = strlen(file)+1; + char* f = new char[size]; + strlcpy(f, file, size); // Strange thing the sizeof(f) doesn't return correct value this->version = version; DL_WriterA* dw = new DL_WriterA(f, version);