aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDFTokenizer.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2019-01-30 20:14:46 +0100
committerJay Berkenbilt <ejb@ql.org>2019-01-31 15:26:37 +0100
commit31372edce0b60211c7af98340b3afa054f414ca4 (patch)
tree8c42952c531b1c665a02b20e4c17fd6b25950883 /libqpdf/QPDFTokenizer.cc
parentc136356378cb6fb240d0784b1787f77f8ab6aa96 (diff)
downloadqpdf-31372edce0b60211c7af98340b3afa054f414ca4.tar.zst
Inline image token value ends with EI, not delimiter
The inline image token erroneously included the delimiter that followed EI. The ObjectHandle created from it was correct.
Diffstat (limited to 'libqpdf/QPDFTokenizer.cc')
-rw-r--r--libqpdf/QPDFTokenizer.cc7
1 files changed, 2 insertions, 5 deletions
diff --git a/libqpdf/QPDFTokenizer.cc b/libqpdf/QPDFTokenizer.cc
index e1399d82..c11c8218 100644
--- a/libqpdf/QPDFTokenizer.cc
+++ b/libqpdf/QPDFTokenizer.cc
@@ -468,6 +468,7 @@ QPDFTokenizer::presentCharacter(char ch)
}
else if (this->m->state == st_inline_image)
{
+ this->m->val += ch;
size_t len = this->m->val.length();
if ((len >= 4) &&
isDelimiter(this->m->val.at(len-4)) &&
@@ -475,22 +476,18 @@ QPDFTokenizer::presentCharacter(char ch)
(this->m->val.at(len-2) == 'I') &&
isDelimiter(this->m->val.at(len-1)))
{
+ this->m->val.erase(len - 1);
this->m->type = tt_inline_image;
this->m->unread_char = true;
this->m->char_to_unread = ch;
this->m->state = st_token_ready;
}
- else
- {
- this->m->val += ch;
- }
}
else
{
handled = false;
}
-
if (handled)
{
// okay