diff -Nuar poppler-0.67.0/poppler/XRef.cc poppler-0.67.0-old/poppler/XRef.cc
--- poppler-0.67.0/poppler/XRef.cc	2021-01-18 16:24:55.368000000 +0800
+++ poppler-0.67.0-old/poppler/XRef.cc	2021-01-18 16:29:29.936000000 +0800
@@ -1628,6 +1628,11 @@
 
 XRefEntry *XRef::getEntry(int i, GBool complainIfMissing)
 {
+  if (unlikely(i < 0)) {
+    error(errInternal, -1, "Request for invalid XRef entry [{0:d}]", i);
+    return &dummyXRefEntry;
+  }
+
   if (i >= size || entries[i].type == xrefEntryNone) {
 
     if ((!xRefStream) && mainXRefEntriesOffset) {
