1
0
Fork 0
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:
Jonas Jenwald 2018-07-15 18:32:05 +02:00
parent 3521424576
commit 17f65908ae
2 changed files with 20 additions and 13 deletions

View file

@ -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;
}