Kaydet (Commit) 85d5385e authored tarafından Caolán McNamara's avatar Caolán McNamara Kaydeden (comit) David Tardon

detect another loop in tif format

Change-Id: I950f751277d9080b4fc00c38f63453cce81bcc32
(cherry picked from commit 49bf2c67)
Reviewed-on: https://gerrit.libreoffice.org/17154Reviewed-by: 's avatarDavid Tardon <dtardon@redhat.com>
Tested-by: 's avatarDavid Tardon <dtardon@redhat.com>
üst 96aaf711
...@@ -1178,10 +1178,19 @@ bool TIFFReader::ReadTIFF(SvStream & rTIFF, Graphic & rGraphic ) ...@@ -1178,10 +1178,19 @@ bool TIFFReader::ReadTIFF(SvStream & rTIFF, Graphic & rGraphic )
{ {
sal_uInt32 nOffset = nFirstIfd; sal_uInt32 nOffset = nFirstIfd;
std::vector<sal_uInt32> aSeenOffsets;
// calculate length of TIFF file // calculate length of TIFF file
do do
{ {
pTIFF->Seek( nOrigPos + nOffset ); if (std::find(aSeenOffsets.begin(), aSeenOffsets.end(), nOffset) != aSeenOffsets.end())
{
SAL_WARN("filter.tiff", "Parsing error: " << nOffset <<
" already processed, format loop");
bStatus = false;
break;
}
pTIFF->Seek(nOrigPos + nOffset);
aSeenOffsets.push_back(nOffset);
if( pTIFF->GetError() ) if( pTIFF->GetError() )
{ {
......
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