Skip fill bytes (0xFF) when decoding JPEG images (issue 5331)
This commit is contained in:
parent
8614c17c1d
commit
3651c9e1f7
@ -792,6 +792,13 @@ var JpegImage = (function jpegImage() {
|
|||||||
successiveApproximation >> 4, successiveApproximation & 15);
|
successiveApproximation >> 4, successiveApproximation & 15);
|
||||||
offset += processed;
|
offset += processed;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 0xFFFF: // Fill bytes
|
||||||
|
if (data[offset] !== 0xFF) { // Avoid skipping a valid marker.
|
||||||
|
offset--;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if (data[offset - 3] === 0xFF &&
|
if (data[offset - 3] === 0xFF &&
|
||||||
data[offset - 2] >= 0xC0 && data[offset - 2] <= 0xFE) {
|
data[offset - 2] >= 0xC0 && data[offset - 2] <= 0xFE) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user