diff options
author | Lei Zhang <thestig@chromium.org> | 2018-09-19 17:26:34 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-09-19 17:26:34 +0000 |
commit | 5f2ea0f6ef587f9f7a2fec9f80dbc82b94c97400 (patch) | |
tree | e8a88e10a99a4bfdd7ffd7eab96583dbc27a756c /core/fpdfapi/parser/fpdf_parser_decode.h | |
parent | c3099d1c694251a654edc6cb72df8adb5e2268ab (diff) | |
download | pdfium-5f2ea0f6ef587f9f7a2fec9f80dbc82b94c97400.tar.xz |
Validate decoder pipelines.
PDF decoders, AKA filters, can be chained together. There can be
an arbitrary number of decoding / decompressing filters in the pipeline,
but there should be at most 1 image decoder, and the image decoder
should only be at the end of the chain.
BUG=chromium:880675
Change-Id: Iffa27c70ec1ed7574e38e0de23413840ee900959
Reviewed-on: https://pdfium-review.googlesource.com/42711
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fpdfapi/parser/fpdf_parser_decode.h')
-rw-r--r-- | core/fpdfapi/parser/fpdf_parser_decode.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/core/fpdfapi/parser/fpdf_parser_decode.h b/core/fpdfapi/parser/fpdf_parser_decode.h index e4fdce1037..57ee271656 100644 --- a/core/fpdfapi/parser/fpdf_parser_decode.h +++ b/core/fpdfapi/parser/fpdf_parser_decode.h @@ -15,11 +15,14 @@ #include "third_party/base/span.h" class CCodec_ScanlineDecoder; +class CPDF_Array; class CPDF_Dictionary; // Indexed by 8-bit char code, contains unicode code points. extern const uint16_t PDFDocEncoding[256]; +bool ValidateDecoderPipeline(const CPDF_Array* pDecoders); + ByteString PDF_EncodeString(const ByteString& src, bool bHex); WideString PDF_DecodeText(const uint8_t* pData, uint32_t size); WideString PDF_DecodeText(const ByteString& bstr); |