Merge df8ed933ffc9d01023ac4485c61ec11ee952837e into 4aca13e77aa2f2c4b5a133aa43fe27bbdf86ad21

This commit is contained in:
Gaurang Bhatia 2025-11-29 10:21:28 -05:00 committed by GitHub
commit 6cac6d7e24
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 11 additions and 3 deletions

View File

@ -1165,15 +1165,15 @@ function readSegmentHeader(data, start) {
let referredToCount = (referredFlags >> 5) & 7;
const retainBits = [referredFlags & 31];
let position = start + 6;
if (referredFlags === 7) {
if (referredToCount === 7) {
referredToCount = readUint32(data, position - 1) & 0x1fffffff;
position += 3;
let bytes = (referredToCount + 7) >> 3;
let bytes = (referredToCount + 8) >> 3;
retainBits[0] = data[position++];
while (--bytes > 0) {
retainBits.push(data[position++]);
}
} else if (referredFlags === 5 || referredFlags === 6) {
} else if (referredToCount === 5 || referredToCount === 6) {
throw new Jbig2Error("invalid referred-to flags");
}

View File

@ -750,6 +750,7 @@
!comments.pdf
!issue20319_1.pdf
!issue20319_2.pdf
!issue20439.pdf
!bug1992868.pdf
!bug1937438_af_from_latex.pdf
!bug1937438_from_word.pdf

BIN
test/pdfs/issue20439.pdf Normal file

Binary file not shown.

View File

@ -2817,6 +2817,13 @@
"rounds": 1,
"type": "eq"
},
{
"id": "issue20439",
"file": "pdfs/issue20439.pdf",
"md5": "3c7e888b26ff00943ec1610d93235efc",
"rounds": 1,
"type": "eq"
},
{
"id": "issue15942",
"file": "pdfs/issue15942.pdf",