From eb49e07c0afc1b30b53d3ae2849c824c9407f00d Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Thu, 31 Jan 2019 15:51:52 -0500 Subject: Make inline image token exactly contain the image data Do not include the trailing EI, and handle cases where EI is not preceded by a delimiter. Such cases have been seen in the wild. --- libqpdf/QPDFObjectHandle.cc | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'libqpdf/QPDFObjectHandle.cc') diff --git a/libqpdf/QPDFObjectHandle.cc b/libqpdf/QPDFObjectHandle.cc index de5d56b3..a3a4d61d 100644 --- a/libqpdf/QPDFObjectHandle.cc +++ b/libqpdf/QPDFObjectHandle.cc @@ -1570,16 +1570,7 @@ QPDFObjectHandle::parseContentStream_data( } else { - // Skip back over EI - input->seek(-2, SEEK_CUR); - std::string inline_image = t.getRawValue(); - for (int i = 0; i < 3; ++i) - { - if (inline_image.length() > 0) - { - inline_image.erase(inline_image.length() - 1); - } - } + std::string inline_image = t.getValue(); QTC::TC("qpdf", "QPDFObjectHandle inline image token"); callbacks->handleObject( QPDFObjectHandle::newInlineImage(inline_image)); -- cgit v1.2.3-70-g09d2