From a53ce196213c12355b4f2ae82bd8d624c2332dbe Mon Sep 17 00:00:00 2001 From: Albert S Date: Mon, 22 Apr 2019 23:13:45 +0200 Subject: [PATCH] PdfProcessor: Throw exception for encrypted/password protected files --- cli/pdfprocessor.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cli/pdfprocessor.cpp b/cli/pdfprocessor.cpp index 4d5f490..ed55daa 100644 --- a/cli/pdfprocessor.cpp +++ b/cli/pdfprocessor.cpp @@ -15,6 +15,12 @@ QVector PdfProcessor::process(const QByteArray &data) const { throw QSSGeneralException("Failed to process pdf data"); } + if(doc->isEncrypted() || doc->isLocked()) + { + throw QSSGeneralException("Doc is encrypted/locked"); + } + + QRectF entirePage; auto pagecount = doc->numPages();