~mcf/mupdf

e27ceb2b0e64b9a56ba79d844ea96553d87dc113 — Robin Watts 3 years ago d0b9c2b
OSS-Fuzz 29728: Avoid buffer overflow.

Don't access past the end of the xref_index.
1 files changed, 1 insertions(+), 1 deletions(-)

M source/pdf/pdf-xref.c
M source/pdf/pdf-xref.c => source/pdf/pdf-xref.c +1 -1
@@ 301,7 301,7 @@ pdf_xref_entry *pdf_get_xref_entry(fz_context *ctx, pdf_document *doc, int i)
	if (i < 0)
		fz_throw(ctx, FZ_ERROR_GENERIC, "Negative object number requested");

	if (i <= doc->max_xref_len)
	if (i < doc->max_xref_len)
		j = doc->xref_index[i];
	else
		j = 0;