diff options
author | Sebastian Rasmussen <sebras@gmail.com> | 2011-10-12 18:31:33 +0200 |
---|---|---|
committer | Sebastian Rasmussen <sebras@gmail.com> | 2011-10-12 18:33:14 +0200 |
commit | c5918f8ec97a9e914666da4a4b4da5bb81f9a77c (patch) | |
tree | 010248f7eb4ad558d51c7e5592e4fdff7b80e9f5 | |
parent | 38abc1f9a91207569b64fc274ccb904094ac4f9a (diff) | |
download | mupdf-c5918f8ec97a9e914666da4a4b4da5bb81f9a77c.tar.xz |
Make sure PDF title is always an allocated string.
Signed-off-by: Sebastian Rasmussen <sebras@gmail.com>
-rw-r--r-- | apps/pdfapp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/pdfapp.c b/apps/pdfapp.c index e96b94e6..3050145f 100644 --- a/apps/pdfapp.c +++ b/apps/pdfapp.c @@ -139,7 +139,7 @@ static void pdfapp_open_pdf(pdfapp_t *app, char *filename, int fd) app->outline = pdf_load_outline(app->xref); - app->doctitle = filename; + app->doctitle = fz_strdup(filename); if (strrchr(app->doctitle, '\\')) app->doctitle = strrchr(app->doctitle, '\\') + 1; if (strrchr(app->doctitle, '/')) @@ -174,7 +174,7 @@ static void pdfapp_open_xps(pdfapp_t *app, char *filename, int fd) pdfapp_error(app, fz_rethrow(error, "cannot open document '%s'", filename)); fz_close(file); - app->doctitle = filename; + app->doctitle = fz_strdup(filename); app->pagecount = xps_count_pages(app->xps); } |