mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Throw error when pixels don't match
This commit is contained in:
parent
7ea770fd08
commit
a21030a502
1 changed files with 4 additions and 0 deletions
|
@ -198,6 +198,10 @@ var PDFImage = (function pdfImage() {
|
|||
var opacityPos = 0;
|
||||
var length = width * height * 4;
|
||||
|
||||
// Is there a one-to-one correspondence between pixels in the loop below?
|
||||
if (length !== 4*comps.length/3)
|
||||
error('Number of image pixels mismatch');
|
||||
|
||||
for (var i = 0; i < length; i += 4) {
|
||||
buffer[i] = comps[compsPos++];
|
||||
buffer[i + 1] = comps[compsPos++];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue