diff options
author | Tor Andersson <tor@ghostscript.com> | 2010-07-15 10:10:46 +0000 |
---|---|---|
committer | Tor Andersson <tor@ghostscript.com> | 2010-07-15 10:10:46 +0000 |
commit | 10425145b4b0d53e587caf88d248c65612698e4d (patch) | |
tree | 11a1ae17d321aac06a0be10f0fa61ae07a0a8fc9 | |
parent | 0c30da9dbe5e18a99ea2cd5a9c7ae3492a7979a7 (diff) | |
download | mupdf-10425145b4b0d53e587caf88d248c65612698e4d.tar.xz |
Check that xref is not null before dereferencing and closing it in the viewer application.
-rw-r--r-- | apps/pdfapp.c | 13 |
1 files 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) |