summaryrefslogtreecommitdiff
path: root/apps/pdfclean.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/pdfclean.c')
-rw-r--r--apps/pdfclean.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/pdfclean.c b/apps/pdfclean.c
index 0f3474ce..82eb7c03 100644
--- a/apps/pdfclean.c
+++ b/apps/pdfclean.c
@@ -775,7 +775,10 @@ int main(int argc, char **argv)
exit(1);
}
- xref = pdf_open_xref(ctx, infile, password);
+ xref = pdf_open_xref(ctx, infile);
+ if (pdf_needs_password(xref))
+ if (!pdf_authenticate_password(xref, password))
+ fz_throw(ctx, "cannot authenticate password: %s\n", infile);
out = fopen(outfile, "wb");
if (!out)