Kaydet (Commit) 5547797c authored tarafından Caolán McNamara's avatar Caolán McNamara

ofz#2980 Timeout

Change-Id: Id36e0e8ae11a145b5efa976c20261af931c1d58b
Reviewed-on: https://gerrit.libreoffice.org/49627Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst d34dcde1
......@@ -29,6 +29,7 @@
#include <sfx2/app.hxx>
#include <sfx2/docfile.hxx>
#include <sfx2/fcontnr.hxx>
#include <unotools/configmgr.hxx>
#include <grfatr.hxx>
#include <fmtanchr.hxx>
#include <fmtcntnt.hxx>
......@@ -267,12 +268,19 @@ bool SwWW8ImplReader::ReadGrafFile(OUString& rFileName, Graphic*& rpGraphic,
}
GDIMetaFile aWMF;
pSt->Seek( nPosFc );
bool bOk = ReadWindowMetafile( *pSt, aWMF );
bool bOk = checkSeek(*pSt, nPosFc) && ReadWindowMetafile( *pSt, aWMF );
if (!bOk || pSt->GetError() || !aWMF.GetActionSize())
return false;
//skip duplicate graphics when fuzzing
if (utl::ConfigManager::IsFuzzing())
{
if (m_aGrafPosSet.find(nPosFc) != m_aGrafPosSet.end())
return false;
m_aGrafPosSet.insert(nPosFc);
}
if (m_xWwFib->m_envr != 1) // !MAC as creator
{
rpGraphic = new Graphic( aWMF );
......
......@@ -1198,6 +1198,11 @@ private:
*/
std::vector<const SwCharFormat*> m_aRubyCharFormats;
/*
For fuzzing keep track of source offset of inserted graphics
*/
std::set<sal_uLong> m_aGrafPosSet;
WW8PostProcessAttrsInfo * m_pPostProcessAttrsInfo;
std::shared_ptr<WW8Fib> m_xWwFib;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment