| author | Albert Astals Cid <aacid@kde.org> | 2007-09-03 17:09:01 (GMT) |
|---|---|---|
| committer | Albert Astals Cid <aacid@kde.org> | 2007-09-03 17:09:01 (GMT) |
| commit | 2a12409ebbf96ea3ca4556b71231a45ae37cb052 (patch) | |
| tree | 2bfefed0214c09dd3146ddde51b437f3128a0704 | |
| parent | 0b483e71ef02b4040b665935c1018c8b30b9c1ca (diff) | |
| download | poppler-2a12409ebbf96ea3ca4556b71231a45ae37cb052.zip poppler-2a12409ebbf96ea3ca4556b71231a45ae37cb052.tar.gz poppler-2a12409ebbf96ea3ca4556b71231a45ae37cb052.tar.bz2 | |
* poppler/JBIG2Stream.cc:
* poppler/Stream.cc: Patch by Derek B. Noonburg <derekn@foolabs.com>
to fix some errors in CCITTFaxStream and JBIG2Stream.cc
| -rw-r--r-- | ChangeLog | 6 | ||||
| -rw-r--r-- | poppler/JBIG2Stream.cc | 7 | ||||
| -rw-r--r-- | poppler/Stream.cc | 2 |
3 files changed, 11 insertions, 4 deletions
@@ -1,3 +1,9 @@ +2007-09-03 Albert Astals Cid <aacid@kde.org> + + * poppler/JBIG2Stream.cc: + * poppler/Stream.cc: Patch by Derek B. Noonburg <derekn@foolabs.com> + to fix some errors in CCITTFaxStream and JBIG2Stream.cc + 2007-09-03 Carlos Garcia Campos <carlosgc@gnome.org> * gtk-doc.make: diff --git a/poppler/JBIG2Stream.cc b/poppler/JBIG2Stream.cc index 5c66113..d1eb99b 100644 --- a/poppler/JBIG2Stream.cc +++ b/poppler/JBIG2Stream.cc @@ -507,7 +507,7 @@ int JBIG2MMRDecoder::getWhiteCode() { ++nBytesRead; } while (1) { - if (bufLen >= 7 && ((buf >> (bufLen - 7)) & 0x7f) == 0) { + if (bufLen >= 11 && ((buf >> (bufLen - 7)) & 0x7f) == 0) { if (bufLen <= 12) { code = buf << (12 - bufLen); } else { @@ -550,14 +550,15 @@ int JBIG2MMRDecoder::getBlackCode() { ++nBytesRead; } while (1) { - if (bufLen >= 6 && ((buf >> (bufLen - 6)) & 0x3f) == 0) { + if (bufLen >= 10 && ((buf >> (bufLen - 6)) & 0x3f) == 0) { if (bufLen <= 13) { code = buf << (13 - bufLen); } else { code = buf >> (bufLen - 13); } p = &blackTab1[code & 0x7f]; - } else if (bufLen >= 4 && ((buf >> (bufLen - 4)) & 0x0f) == 0) { + } else if (bufLen >= 7 && ((buf >> (bufLen - 4)) & 0x0f) == 0 && + ((buf >> (bufLen - 6)) & 0x03) != 0) { if (bufLen <= 12) { code = buf << (12 - bufLen); } else { diff --git a/poppler/Stream.cc b/poppler/Stream.cc index 42e3346..01235eb 100644 --- a/poppler/Stream.cc +++ b/poppler/Stream.cc @@ -1719,7 +1719,7 @@ short CCITTFaxStream::getBlackCode() { code = lookBits(13); if ((code >> 7) == 0) { p = &blackTab1[code]; - } else if ((code >> 9) == 0) { + } else if ((code >> 9) == 0 && (code >> 7) != 0) { p = &blackTab2[(code >> 1) - 64]; } else { p = &blackTab3[code >> 7]; |
