Commit 71077f1154dd1e261cb3f0ecdb881cdd046f7a24

Authored by m-holger
1 parent 611192f3

Use nextToken in QPDFObjectHandle::parseContentStream_data

Showing 1 changed file with 6 additions and 5 deletions
libqpdf/QPDFObjectHandle.cc
@@ -1626,7 +1626,7 @@ QPDFObjectHandle::parseContentStream_data( @@ -1626,7 +1626,7 @@ QPDFObjectHandle::parseContentStream_data(
1626 // Read a token and seek to the beginning. The offset we get from this process is the 1626 // Read a token and seek to the beginning. The offset we get from this process is the
1627 // beginning of the next non-ignorable (space, comment) token. This way, the offset and 1627 // beginning of the next non-ignorable (space, comment) token. This way, the offset and
1628 // don't including ignorable content. 1628 // don't including ignorable content.
1629 - tokenizer.readToken(input, "content", true); 1629 + tokenizer.nextToken(input, "content", true);
1630 qpdf_offset_t offset = input.getLastOffset(); 1630 qpdf_offset_t offset = input.getLastOffset();
1631 input.seek(offset, SEEK_SET); 1631 input.seek(offset, SEEK_SET);
1632 auto obj = 1632 auto obj =
@@ -1644,10 +1644,10 @@ QPDFObjectHandle::parseContentStream_data( @@ -1644,10 +1644,10 @@ QPDFObjectHandle::parseContentStream_data(
1644 char ch; 1644 char ch;
1645 input.read(&ch, 1); 1645 input.read(&ch, 1);
1646 tokenizer.expectInlineImage(input); 1646 tokenizer.expectInlineImage(input);
1647 - QPDFTokenizer::Token t = tokenizer.readToken(input, description, true); 1647 + tokenizer.nextToken(input, description);
1648 offset = input.getLastOffset(); 1648 offset = input.getLastOffset();
1649 length = QIntC::to_size(input.tell() - offset); 1649 length = QIntC::to_size(input.tell() - offset);
1650 - if (t.getType() == QPDFTokenizer::tt_bad) { 1650 + if (tokenizer.getType() == QPDFTokenizer::tt_bad) {
1651 QTC::TC("qpdf", "QPDFObjectHandle EOF in inline image"); 1651 QTC::TC("qpdf", "QPDFObjectHandle EOF in inline image");
1652 warn( 1652 warn(
1653 context, 1653 context,
@@ -1658,10 +1658,11 @@ QPDFObjectHandle::parseContentStream_data( @@ -1658,10 +1658,11 @@ QPDFObjectHandle::parseContentStream_data(
1658 input.tell(), 1658 input.tell(),
1659 "EOF found while reading inline image")); 1659 "EOF found while reading inline image"));
1660 } else { 1660 } else {
1661 - std::string inline_image = t.getValue();  
1662 QTC::TC("qpdf", "QPDFObjectHandle inline image token"); 1661 QTC::TC("qpdf", "QPDFObjectHandle inline image token");
1663 callbacks->handleObject( 1662 callbacks->handleObject(
1664 - QPDFObjectHandle::newInlineImage(inline_image), QIntC::to_size(offset), length); 1663 + QPDFObjectHandle::newInlineImage(tokenizer.getValue()),
  1664 + QIntC::to_size(offset),
  1665 + length);
1665 } 1666 }
1666 } 1667 }
1667 } 1668 }