diff --git a/PdfWriter/OnlineOfficeBinToPdf.cpp b/PdfWriter/OnlineOfficeBinToPdf.cpp index e860e148b7..b4bc551ad8 100644 --- a/PdfWriter/OnlineOfficeBinToPdf.cpp +++ b/PdfWriter/OnlineOfficeBinToPdf.cpp @@ -390,12 +390,16 @@ namespace NSOnlineOfficeBinToPdf case Aggplus::DashStyleCustom: { int nCountDash = ReadInt(current, curindex); - double* pDash = new double[nCountDash]; - for (int nDash = 0; nDash < nCountDash; ++nDash) + if (0 < nCountDash) { - pDash[nDash] = ReadInt(current, curindex) / 100000.0; + double* pDash = new double[nCountDash]; + for (int nDash = 0; nDash < nCountDash; ++nDash) + { + pDash[nDash] = ReadInt(current, curindex) / 100000.0; + } + pPdf->PenDashPattern(pDash, nCountDash); + delete[] pDash; } - pPdf->PenDashPattern(pDash, nCountDash); } default: pPdf->put_PenDashStyle(nDashType);