[poppler] poppler/poppler: Parser.cc,1.2,1.3
Albert Astals Cid
aacid at freedesktop.org
Tue Sep 20 08:27:33 PDT 2005
Update of /cvs/poppler/poppler/poppler
In directory gabe:/tmp/cvs-serv9904/poppler
Modified Files:
Parser.cc
Log Message:
Parser.cc merges from xpdf 3.01
Index: Parser.cc
===================================================================
RCS file: /cvs/poppler/poppler/poppler/Parser.cc,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- Parser.cc 16 Sep 2005 18:29:18 -0000 1.2
+++ Parser.cc 20 Sep 2005 15:27:31 -0000 1.3
@@ -137,6 +137,7 @@
Stream *Parser::makeStream(Object *dict) {
Object obj;
+ BaseStream *baseStr;
Stream *str;
Guint pos, endPos, length;
@@ -165,13 +166,7 @@
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 @@
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;
}
More information about the poppler
mailing list