--- poppler/Lexer.cc.orig 2008-01-21 20:59:14.000000000 +0100 +++ poppler/Lexer.cc 2008-02-18 19:45:57.000000000 +0100 @@ -119,7 +119,7 @@ } int Lexer::lookChar() { - + if (LOOK_VALUE_NOT_CACHED != lookCharLastValueCached) { return lookCharLastValueCached; } @@ -315,12 +315,11 @@ s->append(tokBuf, tokBufSize); p = tokBuf; n = 0; - + // we are growing see if the document is not malformed and we are growing too much if (objNum != -1) { - int newObjNum = xref->getNumEntry(curStr.streamGetPos()); - if (newObjNum != objNum) + if (!xref || xref->getNumEntry(curStr.streamGetPos()) != objNum) { error(getPos(), "Unterminated string"); done = gTrue;