mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-07-04 22:25:50 +02:00
Use the MathClamp helper in the PDFImage.prototype.getComponents method
This commit is contained in:
parent
5b100c4509
commit
be90aa4f46
@ -579,13 +579,7 @@ class PDFImage {
|
||||
}
|
||||
|
||||
const remainingBits = bits - bpc;
|
||||
let value = buf >> remainingBits;
|
||||
if (value < 0) {
|
||||
value = 0;
|
||||
} else if (value > max) {
|
||||
value = max;
|
||||
}
|
||||
output[i] = value;
|
||||
output[i] = MathClamp(buf >> remainingBits, 0, max);
|
||||
buf &= (1 << remainingBits) - 1;
|
||||
bits = remainingBits;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user