From 10425145b4b0d53e587caf88d248c65612698e4d Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Thu, 15 Jul 2010 10:10:46 +0000 Subject: Check that xref is not null before dereferencing and closing it in the viewer application. --- apps/pdfapp.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/apps/pdfapp.c b/apps/pdfapp.c index 990dcd8c..4ec65148 100644 --- a/apps/pdfapp.c +++ b/apps/pdfapp.c @@ -189,12 +189,15 @@ void pdfapp_close(pdfapp_t *app) pdf_freeoutline(app->outline); app->outline = nil; - if (app->xref->store) - pdf_freestore(app->xref->store); - app->xref->store = nil; + if (app->xref) + { + if (app->xref->store) + pdf_freestore(app->xref->store); + app->xref->store = nil; - pdf_closexref(app->xref); - app->xref = nil; + pdf_closexref(app->xref); + app->xref = nil; + } } static fz_matrix pdfapp_viewctm(pdfapp_t *app) -- cgit v1.2.3