Commit ab18b2cb authored by Albert Astals Cid's avatar Albert Astals Cid

Parser.cc merges from xpdf 3.01

parent cf6723ca
2005-09-20 Albert Astals Cid <aacid@kde.org>
* poppler/GlobalParams.[cc|h]: Merge from xpdf 3.01
* poppler/Link.cc: Merge from xpdf 3.01
* poppler/Parser.cc: Merge from xpdf 3.01
* poppler/TextOutputDev.[cc|h]: Merge from xpdf 3.01
* poppler/UnicodeMap.cc: More grealloc -> greallocn
* poppler/UnicodeTypeTable.cc: Merge from xpdf 3.01
......
......@@ -137,6 +137,7 @@ Object *Parser::getObj(Object *obj,
Stream *Parser::makeStream(Object *dict) {
Object obj;
BaseStream *baseStr;
Stream *str;
Guint pos, endPos, length;
......@@ -165,13 +166,7 @@ Stream *Parser::makeStream(Object *dict) {
if (!lexer->getStream()) {
return NULL;
}
// make base stream
str = lexer->getStream()->getBaseStream()->makeSubStream(pos, gTrue,
length, dict);
// get filters
str = str->addFilters(dict);
baseStr = lexer->getStream()->getBaseStream();
// skip over stream data
lexer->setPos(pos + length);
......@@ -183,9 +178,17 @@ Stream *Parser::makeStream(Object *dict) {
shift();
} else {
error(getPos(), "Missing 'endstream'");
str->ignoreLength();
// kludge for broken PDF files: just add 5k to the length, and
// hope its enough
length += 5000;
}
// make base stream
str = baseStr->makeSubStream(pos, gTrue, length, dict);
// get filters
str = str->addFilters(dict);
return str;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment