mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-10 19:56:47 +03:00
fix for crash-8115
This commit is contained in:
parent
45530d5ce1
commit
53c80281d7
BIN
Tests/images/crash-81154a65438ba5aaeca73fd502fa4850fbde60f8.tif
Normal file
BIN
Tests/images/crash-81154a65438ba5aaeca73fd502fa4850fbde60f8.tif
Normal file
Binary file not shown.
|
@ -34,6 +34,7 @@ from .helper import on_ci
|
|||
"Tests/images/crash-f46f5b2f43c370fe65706c11449f567ecc345e74.tif",
|
||||
"Tests/images/crash-63b1dffefc8c075ddc606c0a2f5fdc15ece78863.tif",
|
||||
"Tests/images/crash-74d2a78403a5a59db1fb0a2b8735ac068a75f6e3.tif",
|
||||
"Tests/images/crash-81154a65438ba5aaeca73fd502fa4850fbde60f8.tif",
|
||||
|
||||
],
|
||||
)
|
||||
|
|
|
@ -1250,6 +1250,10 @@ class TiffImageFile(ImageFile.ImageFile):
|
|||
if bps_count > len(bps_tuple) and len(bps_tuple) == 1:
|
||||
bps_tuple = bps_tuple * bps_count
|
||||
|
||||
samplesPerPixel = self.tag_v2.get(SAMPLESPERPIXEL, 1)
|
||||
if len(bps_tuple) != samplesPerPixel:
|
||||
raise SyntaxError("unknown data organization")
|
||||
|
||||
# mode: check photometric interpretation and bits per pixel
|
||||
key = (
|
||||
self.tag_v2.prefix,
|
||||
|
|
Loading…
Reference in New Issue
Block a user