Fix crash on files that have the same signature in more than 1 page

It happens with some official documents where they use the same
signature in all pages to make it clear all pages are signed/official

BUGS: 426467
This commit is contained in:
Albert Astals Cid 2020-09-16 00:27:01 +02:00
parent f1b29aca4f
commit 9bf171a108

View file

@ -790,11 +790,11 @@ void PDFGenerator::loadPages(QVector<Okular::Page *> &pagesVector, int rotation,
if (std::find_if(pageFormFields.begin(), pageFormFields.end(), compareSignatureByFullyQualifiedName) != pageFormFields.end()) {
delete s;
createSignature = false;
continue;
break;
}
}
// See if the signature is in page 0
if (std::find_if(page0FormFields.constBegin(), page0FormFields.constEnd(), compareSignatureByFullyQualifiedName) != page0FormFields.constEnd()) {
if (createSignature && std::find_if(page0FormFields.constBegin(), page0FormFields.constEnd(), compareSignatureByFullyQualifiedName) != page0FormFields.constEnd()) {
delete s;
createSignature = false;
}