[gs-commits] mupdf 1.16.1.36 Avoid dereferencing document pointer if i

[email protected] (Sebastian Rasmussen)
Newsgroups gmane.comp.printing.ghostscript.cvs
Message-ID <[email protected]>
commit 72ea6e6ed9b73b06fa32677de4dc066e3c3e3018
Author: Sebastian Rasmussen <[email protected]>
Date:   Thu Sep 5 23:14:36 2019 +0200

    Avoid dereferencing document pointer if it is NULL.

diff --git a/source/fitz/document.c b/source/fitz/document.c
index b69546e..a4c5f34 100644
--- a/source/fitz/document.c
+++ b/source/fitz/document.c
@@ -456,9 +456,10 @@ fz_load_page(fz_context *ctx, fz_document *doc, int number)
 
 	fz_ensure_layout(ctx, doc);
 
-	for (page = doc->open; page; page = page->next)
-		if (page->number == number)
-			return fz_keep_page(ctx, page);
+	if (doc)
+		for (page = doc->open; page; page = page->next)
+			if (page->number == number)
+				return fz_keep_page(ctx, page);
 
 	if (doc && doc->load_page)
 	{

http://git.ghostscript.com/?p=mupdf.git;a=commit;h=72ea6e6ed9b73b06fa32677de4dc066e3c3e3018

--
MuPDF library
Artifex Software, Inc.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.