File tree 3 files changed +17
-4
lines changed
3 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -163,12 +163,16 @@ var JpegImage = (function JpegImageClosure() {
163
163
} else if ( nextByte === /* EOI = */ 0xd9 ) {
164
164
if ( parseDNLMarker ) {
165
165
// NOTE: only 8-bit JPEG images are supported in this decoder.
166
- const maybeScanLines = blockRow * 8 ;
166
+ const maybeScanLines = blockRow * ( frame . precision === 8 ? 8 : 0 ) ;
167
167
// Heuristic to attempt to handle corrupt JPEG images with too
168
168
// large `scanLines` parameter, by falling back to the currently
169
- // parsed number of scanLines when it's at least one order of
170
- // magnitude smaller than expected (fixes issue10880.pdf).
171
- if ( maybeScanLines > 0 && maybeScanLines < frame . scanLines / 10 ) {
169
+ // parsed number of scanLines when it's at least (approximately)
170
+ // one order of magnitude smaller than expected (fixes
171
+ // issue10880.pdf and issue10989.pdf).
172
+ if (
173
+ maybeScanLines > 0 &&
174
+ Math . round ( frame . scanLines / maybeScanLines ) >= 10
175
+ ) {
172
176
throw new DNLMarkerError (
173
177
"Found EOI marker (0xFFD9) while parsing scan data, " +
174
178
"possibly caused by incorrect `scanLines` parameter" ,
Original file line number Diff line number Diff line change
1
+ https://github.com/mozilla/pdf.js/files/3410726/ArchitecturalPlanProblemPDF_2.pdf
Original file line number Diff line number Diff line change 3746
3746
"lastPage" : 7 ,
3747
3747
"type" : " eq"
3748
3748
},
3749
+ { "id" : " issue10989" ,
3750
+ "file" : " pdfs/issue10989.pdf" ,
3751
+ "md5" : " c16de154d9ae6dbeec0a113911957efe" ,
3752
+ "rounds" : 1 ,
3753
+ "link" : true ,
3754
+ "lastPage" : 1 ,
3755
+ "type" : " eq"
3756
+ },
3749
3757
{ "id" : " issue9650" ,
3750
3758
"file" : " pdfs/issue9650.pdf" ,
3751
3759
"md5" : " 20d50bda6b1080b6d9088811299c791e" ,
You can’t perform that action at this time.
0 commit comments