diff --git a/src/display/annotation_layer.js b/src/display/annotation_layer.js index 00aca1a4c..a71278187 100644 --- a/src/display/annotation_layer.js +++ b/src/display/annotation_layer.js @@ -2410,14 +2410,14 @@ class AnnotationLayer { if (!data) { continue; } - const { width, height } = getRectDims(data.rect); - if (width <= 0 || height <= 0) { - continue; - } if (data.annotationType === AnnotationType.POPUP) { popupAnnotations.push(data); continue; } + const { width, height } = getRectDims(data.rect); + if (width <= 0 || height <= 0) { + continue; // Ignore empty annotations. + } sortedAnnotations.push(data); } if (popupAnnotations.length) { diff --git a/test/pdfs/.gitignore b/test/pdfs/.gitignore index 9fa9ec66c..aa31a6d01 100644 --- a/test/pdfs/.gitignore +++ b/test/pdfs/.gitignore @@ -507,6 +507,7 @@ !xfa_issue14315.pdf !poppler-67295-0.pdf !poppler-85140-0.pdf +!issue15012.pdf !poppler-395-0-fuzzed.pdf !GHOSTSCRIPT-698804-1-fuzzed.pdf !issue14814.pdf diff --git a/test/pdfs/issue15012.pdf b/test/pdfs/issue15012.pdf new file mode 100644 index 000000000..355be954c Binary files /dev/null and b/test/pdfs/issue15012.pdf differ diff --git a/test/test_manifest.json b/test/test_manifest.json index f1b394a8e..39875d3a4 100644 --- a/test/test_manifest.json +++ b/test/test_manifest.json @@ -4951,6 +4951,13 @@ "type": "eq", "forms": true }, + { "id": "issue15012", + "file": "pdfs/issue15012.pdf", + "md5": "cc5e89507262cb3ec6862f68cb3eefd1", + "rounds": 1, + "type": "eq", + "annotations": true + }, { "id": "gesamt", "file": "pdfs/gesamt.pdf", "md5": "743aaa6f46ed0a42864f079d632d942e",