File poppler-null-XRef.patch of Package poppler.30683

diff --git a/poppler/Lexer.cc b/poppler/Lexer.cc
index c6205299..a0a5cd09 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();
openSUSE Build Service is sponsored by