You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2019/12/15 11:00:20 UTC

svn commit: r1871578 - /pdfbox/branches/issue4569/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/AnnotationValidator.java

Author: tilman
Date: Sun Dec 15 11:00:20 2019
New Revision: 1871578

URL: http://svn.apache.org/viewvc?rev=1871578&view=rev
Log:
PDFBOX-4712: The N Appearance of a Btn widget must not be empty

Modified:
    pdfbox/branches/issue4569/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/AnnotationValidator.java

Modified: pdfbox/branches/issue4569/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/AnnotationValidator.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/issue4569/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/AnnotationValidator.java?rev=1871578&r1=1871577&r2=1871578&view=diff
==============================================================================
--- pdfbox/branches/issue4569/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/AnnotationValidator.java (original)
+++ pdfbox/branches/issue4569/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/AnnotationValidator.java Sun Dec 15 11:00:20 2019
@@ -206,6 +206,13 @@ public abstract class AnnotationValidato
                     }
                     if (apn instanceof COSDictionary)
                     {
+                        if (((COSDictionary) apn).size() == 0)
+                        {
+                            // PDFBOX-4712 / https://github.com/veraPDF/veraPDF-library/issues/900
+                            ctx.addValidationError(new ValidationError(ERROR_ANNOT_INVALID_AP_CONTENT,
+                                "The N Appearance of a Btn widget must not be empty"));
+                            return false;
+                        }
                         for (COSBase val : ((COSDictionary) apn).getValues())
                         {
                             // Appearance stream is a XObjectForm, check it.