Skip to content

Commit

Permalink
Fix crash with fonts with symbol > 0x10FFFF and wirh \n in name
Browse files Browse the repository at this point in the history
  • Loading branch information
K0R0L committed Jan 23, 2025
1 parent bd95478 commit a3c87e7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions DesktopEditor/fontengine/ApplicationFontsWorker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,8 @@ class CApplicationFontsWorker_private

virtual void Check(const int& nCode, const unsigned int& nIndex)
{
if (nCode > m_nMaxSymbols)
return;
if (nCode > m_nMax)
m_nMax = nCode;
if (nCode < m_nMin)
Expand Down Expand Up @@ -794,6 +796,8 @@ class CApplicationFontsWorker_private
std::wstring sNameCorrect = pPair->second.m_sName;
NSStringUtils::string_replace(sNameCorrect, L"\\", L"\\\\");
NSStringUtils::string_replace(sNameCorrect, L"\"", L"\\\"");
NSStringUtils::string_replace(sNameCorrect, L"\n", L"");
NSStringUtils::string_replace(sNameCorrect, L"\r", L"");
oWriterJS += sNameCorrect;

oWriterJS.AddSize(120);
Expand Down

0 comments on commit a3c87e7

Please sign in to comment.