Description
The problem appears in version 1.8.1 and in revision 1476791. I
attached a one-line patch that fixes it. This problem is similar to
the already fixed PDFBOX-1447 and PDFBOX-1457.
In method "PDDocument.addSignature", the loop over "cosObjects" should
break immediately after "annotNotFound" and "sigFieldNotFound" are set
to "false". All the iterations after "annotNotFound" and
"sigFieldNotFound" are set to "false" do not perform any useful work
because the two "if" statements performing useful work depend on
"annotNotFound" and "sigFieldNotFound".