For bug 75012

This commit is contained in:
Svetlana Kulikova
2025-06-10 20:19:01 +03:00
parent 646f2ca6b1
commit c0f5336a5a
3 changed files with 12 additions and 4 deletions

View File

@ -1980,7 +1980,9 @@ namespace PdfWriter
CArrayObject* pArrayImage = new CArrayObject();
pMetaOForm->Add("Image", pArrayImage);
}
pArrayMeta->Add(new CStringObject(sXML.c_str()));
CStringObject* pXML = new CStringObject();
pXML->Set(sXML.c_str(), false, false, -1);
pArrayMeta->Add(pXML);
CDictObject* pBDC = new CDictObject();
pBDC->Add("MCID", pArrayMeta->GetCount() - 1);

View File

@ -144,12 +144,17 @@ namespace PdfWriter
m_unLen = 0;
Set(sValue, isUTF16, isDictValue);
}
CStringObject::CStringObject()
{
m_pValue = NULL;
m_unLen = 0;
}
CStringObject::~CStringObject()
{
if (m_pValue)
delete[] m_pValue;
}
void CStringObject::Set(const char* sValue, bool isUTF16, bool isDictValue)
void CStringObject::Set(const char* sValue, bool isUTF16, bool isDictValue, int nMax)
{
if (m_pValue)
{
@ -157,7 +162,7 @@ namespace PdfWriter
m_unLen = 0;
}
unsigned int unLen = StrLen(sValue, LIMIT_MAX_STRING_LEN);
unsigned int unLen = StrLen(sValue, nMax);
m_pValue = new BYTE[unLen + 1];
StrCpy((char*)m_pValue, (char*)sValue, (char*)(m_pValue + unLen));
m_unLen = unLen;

View File

@ -297,8 +297,9 @@ namespace PdfWriter
{
public:
CStringObject(const char* sValue, bool isUTF16 = false, bool isDictValue = false);
CStringObject();
virtual ~CStringObject();
void Set(const char* sValue, bool isUTF16, bool isDictValue);
void Set(const char* sValue, bool isUTF16, bool isDictValue, int nMax = LIMIT_MAX_STRING_LEN);
const BYTE* GetString() const
{
return (const BYTE*)m_pValue;