Merge pull request 'fix/fix-bugs-9.2.1' (#566) from fix/fix-bugs-9.2.1 into hotfix/v9.2.1

Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/566
This commit is contained in:
Elena Subbotina
2025-12-11 08:16:12 +00:00
7 changed files with 25 additions and 12 deletions

View File

@ -72,7 +72,14 @@ void AutoFilter::readFields(CFRecord& record)
{
size_t pos_record = record.getRdPtr();
if (size == 0xffffffff) size = record.getDataSize() - pos_record;
if (size == 0xffffffff)
size = record.getDataSize() - pos_record;
else if(record.getDataSize() < pos_record + size)
{
//size error
return;
}
if (size > 0)
{

View File

@ -55,6 +55,8 @@ void DataFormat::readFields(CFRecord& record)
unsigned short flags;
record >> xi >> yi >> iss >> flags;
fUnknown = GETBIT(flags, 0);
if(iss > 1000)
iss = 0;
}
void DataFormat::writeFields(CFRecord& record)

View File

@ -148,7 +148,7 @@ int MarkerFormat::serialize(std::wostream & _stream, int index, BaseObjectPtr _G
{
CP_XML_NODE(L"a:srgbClr")
{
CP_XML_ATTR(L"val", (false == fAuto || index < 0) ? rgbBack.strRGB : default_marker_color[index]);
CP_XML_ATTR(L"val", (false == fAuto || index < 0 || index > default_marker_color->size()) ? rgbBack.strRGB : default_marker_color[index]);
}
}
}
@ -158,7 +158,7 @@ int MarkerFormat::serialize(std::wostream & _stream, int index, BaseObjectPtr _G
{
CP_XML_NODE(L"a:srgbClr")
{
CP_XML_ATTR(L"val", (false == fAuto || index < 0) ? rgbFore.strRGB : default_marker_color[index]);
CP_XML_ATTR(L"val", (false == fAuto || index < 0 || index > default_marker_color->size()) ? rgbFore.strRGB : default_marker_color[index]);
}
}
CP_XML_NODE(L"a:prstDash") { CP_XML_ATTR(L"val", L"solid"); }

View File

@ -53,7 +53,7 @@ void Feat11FdaAutoFilter::load(CFRecord& record)
}
record.skipNunBytes(2);
if (cbAutoFilter > 0 && cbAutoFilter < 2080)
if (cbAutoFilter > 0 && cbAutoFilter < 2080 && (record.getDataSize() - record.getRdPtr()) >= cbAutoFilter)
{
recAutoFilter.size = cbAutoFilter;
recAutoFilter.readFields(record);

View File

@ -153,7 +153,8 @@ const bool ATTACHEDLABEL::loadContent(BinProcessor& proc)
proc.optional<CRTMLFRT>();
proc.mandatory<End>(); elements_.pop_back();
if(proc.mandatory<End>())
elements_.pop_back();
return true;
}

View File

@ -80,10 +80,11 @@ const bool LD::loadContent(BinProcessor& proc)
elements_.pop_back();
}
proc.mandatory<ATTACHEDLABEL>();
m_ATTACHEDLABEL = elements_.back();
elements_.pop_back();
if(proc.mandatory<ATTACHEDLABEL>())
{
m_ATTACHEDLABEL = elements_.back();
elements_.pop_back();
}
if (proc.optional<FRAME>())
{
@ -102,7 +103,8 @@ const bool LD::loadContent(BinProcessor& proc)
elements_.pop_back();
}
proc.optional<CRTMLFRT>();
proc.mandatory<End>(); elements_.pop_back();
if(proc.mandatory<End>())
elements_.pop_back();
return true;
}

View File

@ -305,7 +305,7 @@ int SS::serialize_default(std::wostream & _stream, int series_type, int ind )
if ((line) && (line->lns == (_UINT16)5)) ind = -1;
}
if (ind >= 0 && m_isAutoLine)
if (ind >= 0 && default_series_line_color->size() > ind && m_isAutoLine)
{
CP_XML_NODE(L"a:ln")
{
@ -444,7 +444,8 @@ int SS::serialize(std::wostream & _stream, int series_type, int indPt)
{
CP_XML_NODE(L"a:srgbClr")
{
CP_XML_ATTR(L"val", default_series_line_color[ind]);
if(default_series_line_color->size() > ind)
CP_XML_ATTR(L"val", default_series_line_color[ind]);
}
}
CP_XML_NODE(L"a:prstDash")