diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2022-04-24 03:42:26 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2022-04-24 03:42:26 +0000 |
commit | d743821ec3b71e00af5dc5541d4e7bf5b003c55e (patch) | |
tree | 8145068541ec45af3c223f5a35891d02e4adf273 /Build/source/libs/xpdf/xpdf-src/xpdf/Stream.h | |
parent | d0ce904282bf50ad444cf1ff7df7edd12a3b5a70 (diff) |
xpdf 4.04
git-svn-id: svn://tug.org/texlive/trunk@63119 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/xpdf/xpdf-src/xpdf/Stream.h')
-rw-r--r-- | Build/source/libs/xpdf/xpdf-src/xpdf/Stream.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/Stream.h b/Build/source/libs/xpdf/xpdf-src/xpdf/Stream.h index 59cafadc14f..9d084c94895 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/Stream.h +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/Stream.h @@ -80,6 +80,13 @@ public: virtual GBool isEmbedStream() { return gFalse; } + // Disable checking for 'decompression bombs', i.e., cases where the + // encryption ratio looks suspiciously high. This should be called + // for things like images which (a) can have very high compression + // ratios in certain cases, and (b) have fixed data sizes controlled + // by the reader. + virtual void disableDecompressionBombChecking() {} + // Reset stream to beginning. virtual void reset() = 0; @@ -192,6 +199,8 @@ public: FilterStream(Stream *strA); virtual ~FilterStream(); + virtual void disableDecompressionBombChecking() + { str->disableDecompressionBombChecking(); } virtual void close(); virtual GFileOffset getPos() { return str->getPos(); } virtual void setPos(GFileOffset pos, int dir = 0); @@ -472,6 +481,7 @@ public: virtual ~LZWStream(); virtual Stream *copy(); virtual StreamKind getKind() { return strLZW; } + virtual void disableDecompressionBombChecking(); virtual void reset(); virtual int getChar(); virtual int lookChar(); @@ -501,6 +511,7 @@ private: int seqLength; // length of current sequence int seqIndex; // index into current sequence GBool first; // first code after a table clear + GBool checkForDecompressionBombs; unsigned long long totalIn; // total number of encoded bytes read so far unsigned long long totalOut; // total number of bytes decoded so far @@ -693,6 +704,7 @@ private: #else // HAVE_JPEGLIB + GBool prepared; // set after prepare() is called GBool progressive; // set if in progressive mode GBool interleaved; // set if in interleaved mode int width, height; // image size @@ -724,6 +736,7 @@ private: int inputBuf; // input buffer for variable length codes int inputBits; // number of valid bits in input buffer + void prepare(); void restart(); GBool readMCURow(); void readScan(); @@ -791,6 +804,7 @@ public: virtual ~FlateStream(); virtual Stream *copy(); virtual StreamKind getKind() { return strFlate; } + virtual void disableDecompressionBombChecking(); virtual void reset(); virtual int getChar(); virtual int lookChar(); @@ -816,6 +830,7 @@ private: int blockLen; // remaining length of uncompressed block GBool endOfBlock; // set when end of block is reached GBool eof; // set when end of stream is reached + GBool checkForDecompressionBombs; unsigned long long totalIn; // total number of encoded bytes read so far unsigned long long totalOut; // total number of bytes decoded so far |