[src/core/jpg.js] Remove redundant marker validation at the end of the decodeScan function (PR 11805 follow-up)

With the MCU parsing changes made in PR 11805, the final marker validation is no longer necessary before the `decodeScan` function returns.
This commit is contained in:
Jonas Jenwald 2020-04-17 15:40:02 +02:00
parent c218e94f66
commit 518d26dfb4

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;
}