[poppler] Branch 'poppler-0.26' - poppler/Lexer.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Tue Jun 17 15:33:14 PDT 2014


 poppler/Lexer.cc |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 310fbeec692b02d555e3e8dd6c851be11b25e26a
Author: Albert Astals Cid <aacid at kde.org>
Date:   Wed Jun 18 00:31:48 2014 +0200

    Make sure we have an xref before using
    
    KDE bug #335413 had this backtrace
    XRef::getNumEntry (this=0x0, offset=-1) at XRef.cc:1300
    0x00007f29aec1681e in Lexer::getObj (this=0x1648760, obj=obj at entry=0x1bdf978, cmdA=cmdA at entry=0x7f29aeca66c8 "endstream", objNum=objNum at entry=0) at Lexer.cc:594
    0x00007f29aec20dfd in Parser::shift (this=this at entry=0x1bdf950, cmdA=cmdA at entry=0x7f29aeca66c8 "endstream", objNum=objNum at entry=0) at Parser.cc:323
    0x00007f29aec20fde in Parser::makeStream (this=this at entry=0x1bdf950, dict=dict at entry=0x7fff2541cad0, fileKey=fileKey at entry=0x0, encAlgorithm=encAlgorithm at entry=cryptRC4, keyLength=keyLength at entry=0, objNum=objNum at entry=0, objGen=objGen at entry=0, recursion=recursion at entry=1, strict=strict at entry=false) at Parser.cc:245
    0x00007f29aec216b8 in Parser::getObj (this=this at entry=0x1bdf950, obj=obj at entry=0x7fff2541cad0, simpleOnly=simpleOnly at entry=false, fileKey=fileKey at entry=0x0, encAlgorithm=encAlgorithm at entry=cryptRC4, keyLength=keyLength at entry=0, objNum=objNum at entry=0, objGen=objGen at entry=0, recursion=recursion at entry=0, strict=strict at entry=false) at Parser.cc:131
    0x00007f29aec350fc in XRef::readXRef (this=this at entry=0xfe43a0, pos=pos at entry=0xfe4438, followedXRefStm=followedXRefStm at entry=0x7fff2541cb30, xrefStreamObjsNum=xrefStreamObjsNum at entry=0x0) at XRef.cc:551
    0x00007f29aec35319 in XRef::XRef (this=0xfe43a0, strA=0x1c54ff0, pos=<optimized out>, mainXRefEntriesOffsetA=0, wasReconstructed=0x7fff2541cbaf, reconstruct=<optimized out>) at XRef.cc:342
    0x00007f29aec2534f in PDFDoc::setup (this=this at entry=0x311e1b0, ownerPassword=ownerPassword at entry=0x1165830, userPassword=userPassword at entry=0x447f550) at PDFDoc.cc:262

diff --git a/poppler/Lexer.cc b/poppler/Lexer.cc
index c620529..a0a5cd0 100644
--- a/poppler/Lexer.cc
+++ b/poppler/Lexer.cc
@@ -591,7 +591,7 @@ Object *Lexer::getObj(Object *obj, const char *cmdA, int objNum) {
   comment = gFalse;
   const char *cmd1 = tokBuf;
   *tokBuf = 0;
-  while (strcmp(cmdA, cmd1) && (objNum < 0 || xref->getNumEntry(getPos()) == objNum)) {
+  while (strcmp(cmdA, cmd1) && (objNum < 0 || (xref && xref->getNumEntry(getPos()) == objNum))) {
     while (1) {
       if ((c = getChar()) == EOF) {
         return obj->initEOF();


More information about the poppler mailing list