summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-08-27 14:40:37 +0100
committerMichael Meeks <michael.meeks@collabora.com>2015-08-28 09:41:00 +0000
commita6ea269296089b43dd5810f418e8e1239f30a565 (patch)
tree8e1db585fb0681618f512a5a0d499e926736811f /filter
parentb678e62b36418aa8dcac8fd268a31441434ec116 (diff)
crashtesting: tiff loop detection too slow
moz323894-1.tiff and moz456356-1.tiff take too long to load Change-Id: Iaafa064fd05e4a4152004e7ceb6256af68aeef01 (cherry picked from commit 7e373e92fc02393732422d05264dd5115076183f) Reviewed-on: https://gerrit.libreoffice.org/18095 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'filter')
-rw-r--r--filter/source/graphicfilter/itiff/lzwdecom.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/filter/source/graphicfilter/itiff/lzwdecom.cxx b/filter/source/graphicfilter/itiff/lzwdecom.cxx
index 5fb7514d62db..dc437e27e678 100644
--- a/filter/source/graphicfilter/itiff/lzwdecom.cxx
+++ b/filter/source/graphicfilter/itiff/lzwdecom.cxx
@@ -20,7 +20,7 @@
#include "lzwdecom.hxx"
#include <algorithm>
-#include <vector>
+#include <set>
#define MAX_TABLE_SIZE 4096
@@ -163,16 +163,16 @@ void LZWDecompressor::AddToTable(sal_uInt16 nPrevCode, sal_uInt16 nCodeFirstData
return;
}
- std::vector<sal_uInt16> aSeenIndexes;
+ unsigned char aSeenIndexes[MAX_TABLE_SIZE] = {0};
while (pTable[nCodeFirstData].nDataCount>1)
{
- if (std::find(aSeenIndexes.begin(), aSeenIndexes.end(), nCodeFirstData) != aSeenIndexes.end())
+ if (aSeenIndexes[nCodeFirstData])
{
SAL_WARN("filter.tiff", "Loop in chain");
bEOIFound = true;
return;
}
- aSeenIndexes.push_back(nCodeFirstData);
+ aSeenIndexes[nCodeFirstData] = 1;
nCodeFirstData=pTable[nCodeFirstData].nPrevCode;
}