mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-10 19:56:47 +03:00
Merge pull request #1337 from homm/extraneous-jpeg-bytes
Skip any number extraneous chars at the end of JPEG chunks
This commit is contained in:
commit
60f44f2dce
|
@ -288,7 +288,7 @@ class JpegImageFile(ImageFile.ImageFile):
|
|||
|
||||
s = self.fp.read(1)
|
||||
|
||||
if i8(s[0]) != 255:
|
||||
if i8(s) != 255:
|
||||
raise SyntaxError("not a JPEG file")
|
||||
|
||||
# Create attributes
|
||||
|
@ -311,7 +311,7 @@ class JpegImageFile(ImageFile.ImageFile):
|
|||
i = i16(s)
|
||||
else:
|
||||
# Skip non-0xFF junk
|
||||
s = b"\xff"
|
||||
s = self.fp.read(1)
|
||||
continue
|
||||
|
||||
if i in MARKER:
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 105 KiB After Width: | Height: | Size: 105 KiB |
Loading…
Reference in New Issue
Block a user