summaryrefslogtreecommitdiff
path: root/source/tools
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@gmail.com>2018-03-20 12:49:50 +0800
committerSebastian Rasmussen <sebras@gmail.com>2018-03-22 12:33:34 +0800
commitbedb98a87a38a64b67d9a27e08b459dd216b2de9 (patch)
tree670588190883fbbe9349f5979e10d74c7cb11104 /source/tools
parente681d1348c077fca18781bb577505c57f6336f8f (diff)
downloadmupdf-bedb98a87a38a64b67d9a27e08b459dd216b2de9.tar.xz
Fix 699130: Handle missing arguments in directives in mutool create.
Diffstat (limited to 'source/tools')
-rw-r--r--source/tools/pdfcreate.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/tools/pdfcreate.c b/source/tools/pdfcreate.c
index 032f32d5..aa0e246e 100644
--- a/source/tools/pdfcreate.c
+++ b/source/tools/pdfcreate.c
@@ -165,16 +165,22 @@ static void create_page(char *input)
{
s = fz_strsep(&p, " ");
t = fz_strsep(&p, " ");
+ if (!s || !t || !p)
+ fz_throw(ctx, FZ_ERROR_GENERIC, "Font directive missing arguments");
add_font_res(resources, s, t, p);
}
else if (!strcmp(s, "%%CJKFont"))
{
s = fz_strsep(&p, " ");
+ if (!s || !p)
+ fz_throw(ctx, FZ_ERROR_GENERIC, "CJKFont directive missing arguments");
add_cjkfont_res(resources, s, p);
}
else if (!strcmp(s, "%%Image"))
{
s = fz_strsep(&p, " ");
+ if (!s || !p)
+ fz_throw(ctx, FZ_ERROR_GENERIC, "Image directive missing arguments");
add_image_res(resources, s, p);
}
}