ofz: infinite loop

Change-Id: Ie42e73ebe02cd4c2bb10c9d0e55a5256b1fffd15
Reviewed-on: https://gerrit.libreoffice.org/59248
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
Caolán McNamara
2018-08-17 09:15:02 +01:00
parent b83fac898a
commit c05692cbcd

View File

@@ -651,13 +651,16 @@ LwpDocument* LwpDocument::GetLastDivisionWithContents()
return this;
LwpDocument* pDivision = GetFirstDivision();
std::set<LwpDocument*> aSeen;
while (pDivision)
{
aSeen.insert(pDivision);
LwpDocument* pContentDivision = pDivision->GetFirstDivisionWithContentsThatIsNotOLE();
if(pContentDivision)
if (pContentDivision)
return pContentDivision;
pDivision = pDivision->GetNextDivision();
if (aSeen.find(pDivision) != aSeen.end())
throw std::runtime_error("loop in conversion");
}
return nullptr;
}