From d0b9c2be091749dbed2299e9186f632bfd048ce7 Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Tue, 26 Jan 2021 17:13:22 +0000 Subject: [PATCH] Coverity 216668: Avoid null deref. Probably never happens in practise as we don't go looking for objects that don't exist, but this is safer. --- source/pdf/pdf-xref.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/pdf/pdf-xref.c b/source/pdf/pdf-xref.c index 30197b4b8..a160d20b1 100644 --- a/source/pdf/pdf-xref.c +++ b/source/pdf/pdf-xref.c @@ -662,6 +662,8 @@ void pdf_xref_ensure_local_object(fz_context *ctx, pdf_document *doc, int num) break; } /* sub == NULL implies we did not find it */ + if (sub == NULL) + return; /* No object to find */ /* Copy the object to the local section */ doc->xref_index[num] = 0; -- 2.38.4