poppler/Stream.cc | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-)
New commits: commit d72f0383b959d8495a452d2d32377e588b15ad65 Author: Kay Dohmann <[email protected]> Date: Mon Oct 23 23:31:13 2017 +0200 Tweak LZWStream::processNextCode Fixes file attached at bug 103174 and doesn't seem to cause any regression in the files we have around Bug #103174 diff --git a/poppler/Stream.cc b/poppler/Stream.cc index b541356d..da1d9267 100644 --- a/poppler/Stream.cc +++ b/poppler/Stream.cc @@ -33,6 +33,7 @@ // Copyright (C) 2015 Suzuki Toshiya <[email protected]> // Copyright (C) 2015 Jason Crain <[email protected]> // Copyright (C) 2017 Jose Aliste <[email protected]> +// Copyright (C) 2017 Kay Dohmann <[email protected]> // // To see a description of the changes please see the Changelog file that // came with your tarball or type make ChangeLog if you are building from git @@ -1461,11 +1462,6 @@ GBool LZWStream::processNextCode() { clearTable(); goto start; } - if (nextCode >= 4097) { - error(errSyntaxError, getPos(), - "Bad LZW stream - expected clear-table code"); - clearTable(); - } // process the next code nextLength = seqLength + 1; @@ -1491,10 +1487,12 @@ GBool LZWStream::processNextCode() { if (first) { first = gFalse; } else { - table[nextCode].length = nextLength; - table[nextCode].head = prevCode; - table[nextCode].tail = newChar; - ++nextCode; + if (nextCode < 4097) { + table[nextCode].length = nextLength; + table[nextCode].head = prevCode; + table[nextCode].tail = newChar; + ++nextCode; + } if (nextCode + early == 512) nextBits = 10; else if (nextCode + early == 1024) _______________________________________________ poppler mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/poppler
