aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2017-07-26 11:35:34 +0200
committerJay Berkenbilt <ejb@ql.org>2017-07-26 12:24:07 +0200
commit12db09898e70fcdc308cf500a95fb166e696b6dc (patch)
treea77bc229ce63c1fd95a6c2968ba766e481733b57 /libqpdf
parent701b518d5c56a1449825a3a37a716c58e05e1c3e (diff)
downloadqpdf-12db09898e70fcdc308cf500a95fb166e696b6dc.tar.zst
Don't interpret word tokens in content streams (fixes #82)
Diffstat (limited to 'libqpdf')
-rw-r--r--libqpdf/QPDFObjectHandle.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/libqpdf/QPDFObjectHandle.cc b/libqpdf/QPDFObjectHandle.cc
index cd3084cb..fcf9b976 100644
--- a/libqpdf/QPDFObjectHandle.cc
+++ b/libqpdf/QPDFObjectHandle.cc
@@ -964,7 +964,11 @@ QPDFObjectHandle::parseInternal(PointerHolder<InputSource> input,
case QPDFTokenizer::tt_word:
{
std::string const& value = token.getValue();
- if ((value == "R") && (in_array || in_dictionary) &&
+ if (content_stream)
+ {
+ object = QPDFObjectHandle::newOperator(value);
+ }
+ else if ((value == "R") && (in_array || in_dictionary) &&
(olist.size() >= 2) &&
(! olist.at(olist.size() - 1).isIndirect()) &&
(olist.at(olist.size() - 1).isInteger()) &&
@@ -996,10 +1000,6 @@ QPDFObjectHandle::parseInternal(PointerHolder<InputSource> input,
input->seek(input->getLastOffset(), SEEK_SET);
empty = true;
}
- else if (content_stream)
- {
- object = QPDFObjectHandle::newOperator(token.getValue());
- }
else
{
throw QPDFExc(qpdf_e_damaged_pdf, input->getName(),