mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 17:36:18 +03:00
skip any number extraneous chars at the end of chunks
This commit is contained in:
parent
8c3f66a9ae
commit
0b19a86087
|
@ -288,7 +288,7 @@ class JpegImageFile(ImageFile.ImageFile):
|
||||||
|
|
||||||
s = self.fp.read(1)
|
s = self.fp.read(1)
|
||||||
|
|
||||||
if i8(s[0]) != 255:
|
if i8(s) != 255:
|
||||||
raise SyntaxError("not a JPEG file")
|
raise SyntaxError("not a JPEG file")
|
||||||
|
|
||||||
# Create attributes
|
# Create attributes
|
||||||
|
@ -311,7 +311,7 @@ class JpegImageFile(ImageFile.ImageFile):
|
||||||
i = i16(s)
|
i = i16(s)
|
||||||
else:
|
else:
|
||||||
# Skip non-0xFF junk
|
# Skip non-0xFF junk
|
||||||
s = b"\xff"
|
s = self.fp.read(1)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if i in MARKER:
|
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