mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 01:58:06 +02:00
Add more validation of the /Filter entry, in image dictionaries, to the PDFImage
constructor
Given that the code is currently assuming that the /Filter entry is a `Name`, it cannot hurt to actually ensure that's the case. Also fixes an error message, for JPEG 2000 images with unsupported ColorSpaces, since `this.numComps` hasn't been initialized when it's accessed during the `throw new Error()` invocation.
This commit is contained in:
parent
3521424576
commit
17f65908ae
2 changed files with 20 additions and 13 deletions
|
@ -142,7 +142,7 @@ var JpxImage = (function JpxImageClosure() {
|
|||
this.width = Xsiz - XOsiz;
|
||||
this.height = Ysiz - YOsiz;
|
||||
this.componentsCount = Csiz;
|
||||
// Results are always returned as Uint8Arrays
|
||||
// Results are always returned as `Uint8ClampedArray`s.
|
||||
this.bitsPerComponent = 8;
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue