Merge pull request #11819 from Snuffleupagus/decodeScan-rm-findNextFileMarker-call

[src/core/jpg.js] Remove redundant marker validation at the end of the `decodeScan` function (PR 11805 follow-up)
This commit is contained in:
Tim van der Meij 2020-04-18 00:10:46 +02:00 committed by GitHub
commit c1733d2bcd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -136,8 +136,8 @@ var JpegImage = (function JpegImageClosure() {
var mcusPerLine = frame.mcusPerLine;
var progressive = frame.progressive;
var startOffset = offset,
bitsData = 0,
const startOffset = offset;
let bitsData = 0,
bitsCount = 0;
function readBit() {
@ -455,16 +455,6 @@ var JpegImage = (function JpegImageClosure() {
}
}
fileMarker = findNextFileMarker(data, offset);
// Some images include more Scan blocks than expected, skip past those and
// attempt to find the next valid marker (fixes issue8182.pdf).
if (fileMarker && fileMarker.invalid) {
warn(
`decodeScan - unexpected Scan data, current marker is: ${fileMarker.invalid}`
);
offset = fileMarker.offset;
}
return offset - startOffset;
}