Commit b54e1fc3 authored by Adam Reichold's avatar Adam Reichold

Also defend against requests for negative XRef indices. oss-fuzz/12797

parent 3cc40be2
......@@ -1565,6 +1565,11 @@ DummyXRefEntry dummyXRefEntry;
XRefEntry *XRef::getEntry(int i, bool 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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment