mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-10 19:56:47 +03:00
Skip extra 0xff00 in jpeg
This commit is contained in:
parent
30eced6286
commit
c8f93c979c
|
@ -331,6 +331,8 @@ class JpegImageFile(ImageFile.ImageFile):
|
|||
elif i == 0 or i == 0xFFFF:
|
||||
# padded marker or junk; move on
|
||||
s = b"\xff"
|
||||
elif i == 0xFF00: # Skip extraneous data (escaped 0xFF)
|
||||
s = self.fp.read(1)
|
||||
else:
|
||||
raise SyntaxError("no marker found")
|
||||
|
||||
|
|
BIN
Tests/images/jpeg_ff00_header.jpg
Normal file
BIN
Tests/images/jpeg_ff00_header.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 84 KiB |
|
@ -303,6 +303,10 @@ class TestFileJpeg(PillowTestCase):
|
|||
filename = "Tests/images/junk_jpeg_header.jpg"
|
||||
Image.open(filename)
|
||||
|
||||
def test_ff00_jpeg_header(self):
|
||||
filename = "Tests/images/jpeg_ff00_header.jpg"
|
||||
Image.open(filename)
|
||||
|
||||
def _n_qtables_helper(self, n, test_file):
|
||||
im = Image.open(test_file)
|
||||
f = self.tempfile('temp.jpg')
|
||||
|
|
Loading…
Reference in New Issue
Block a user