mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-12 10:16:17 +03:00
Removed OSError in favour of DecompressionBombError
This commit is contained in:
parent
15c339470d
commit
518b783c64
|
@ -60,6 +60,10 @@ class TestDecompressionBomb:
|
||||||
with pytest.raises(Image.DecompressionBombError):
|
with pytest.raises(Image.DecompressionBombError):
|
||||||
Image.open("Tests/images/decompression_bomb.gif")
|
Image.open("Tests/images/decompression_bomb.gif")
|
||||||
|
|
||||||
|
def test_exception_bmp(self):
|
||||||
|
with pytest.raises(Image.DecompressionBombError):
|
||||||
|
Image.open("Tests/images/bmp/b/reallybig.bmp")
|
||||||
|
|
||||||
|
|
||||||
class TestDecompressionCrop:
|
class TestDecompressionCrop:
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|
|
@ -162,10 +162,6 @@ class BmpImageFile(ImageFile.ImageFile):
|
||||||
else (1 << file_info["bits"])
|
else (1 << file_info["bits"])
|
||||||
)
|
)
|
||||||
|
|
||||||
# ------------------------------- Check abnormal values for DOS attacks
|
|
||||||
if file_info["width"] * file_info["height"] > 2 ** 31:
|
|
||||||
raise OSError("Unsupported BMP Size: (%dx%d)" % self.size)
|
|
||||||
|
|
||||||
# ---------------------- Check bit depth for unusual unsupported values
|
# ---------------------- Check bit depth for unusual unsupported values
|
||||||
self.mode, raw_mode = BIT2MODE.get(file_info["bits"], (None, None))
|
self.mode, raw_mode = BIT2MODE.get(file_info["bits"], (None, None))
|
||||||
if self.mode is None:
|
if self.mode is None:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user