Seek raises OverFlowError on 32-bit

This commit is contained in:
Andrew Murray 2026-04-01 09:46:09 +11:00
parent d9035515f2
commit f5e893e46e

View File

@ -12,7 +12,6 @@ from .helper import (
assert_image_similar,
hopper,
is_pypy,
is_win32,
)
test_file = "Tests/images/hopper.psd"
@ -213,15 +212,15 @@ def test_bounds_crash(test_file: str) -> None:
im.load()
@pytest.mark.skipif(
is_win32() and sys.version_info < (3, 11),
reason="OverflowError on Windows Python 3.10",
)
def test_bounds_crash_overflow() -> None:
with Image.open("Tests/images/psd-oob-write-overflow.psd") as im:
assert isinstance(im, PsdImagePlugin.PsdImageFile)
im.load()
im.seek(im.n_frames)
if sys.maxsize <= 2**32:
with pytest.raises(OverflowError):
im.seek(im.n_frames)
else:
im.seek(im.n_frames)
with pytest.raises(ValueError):
im.load()
with pytest.raises(ValueError):
im.load()