From 12db09898e70fcdc308cf500a95fb166e696b6dc Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Wed, 26 Jul 2017 05:35:34 -0400 Subject: Don't interpret word tokens in content streams (fixes #82) --- libqpdf/QPDFObjectHandle.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'libqpdf') 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 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 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(), -- cgit v1.2.3-54-g00ecf