mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-23 08:38:06 +02:00
Ensure that AnnotationBorderStyle.setWidth
is able to handle the input being a Name
, to correctly deal with corrupt PDF documents (issue 10385)
This commit is contained in:
parent
15b3806937
commit
76a9580aeb
2 changed files with 13 additions and 0 deletions
|
@ -482,6 +482,11 @@ class AnnotationBorderStyle {
|
|||
* @param {integer} width - The width
|
||||
*/
|
||||
setWidth(width) {
|
||||
// Some corrupt PDF generators may provide the width as a `Name`,
|
||||
// rather than as a number (fixes issue 10385).
|
||||
if (isName(width)) {
|
||||
width = parseFloat(width.name);
|
||||
}
|
||||
if (Number.isInteger(width)) {
|
||||
this.width = width;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue