mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 10:08:06 +02:00
Prevent an infinite loop when parsing corrupt /CCITTFaxDecode data (issue 14305)
Fixes one of the documents in issue 14305.
This commit is contained in:
parent
c42b19f26a
commit
e8562173b8
4 changed files with 7097 additions and 1 deletions
|
@ -19,7 +19,7 @@
|
|||
* license.
|
||||
*/
|
||||
|
||||
import { info } from "../shared/util.js";
|
||||
import { FormatError, info } from "../shared/util.js";
|
||||
|
||||
/**
|
||||
* @typedef {Object} CCITTFaxDecoderSource
|
||||
|
@ -811,6 +811,12 @@ class CCITTFaxDecoder {
|
|||
bits = 8;
|
||||
c = 0;
|
||||
do {
|
||||
if (typeof this.outputBits !== "number") {
|
||||
throw new FormatError(
|
||||
'Invalid /CCITTFaxDecode data, "outputBits" must be a number.'
|
||||
);
|
||||
}
|
||||
|
||||
if (this.outputBits > bits) {
|
||||
c <<= bits;
|
||||
if (!(this.codingPos & 1)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue