Pillow/Tests/check_j2k_overflow.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
298 B
Python
Raw Normal View History

from __future__ import annotations
2024-01-20 14:23:03 +03:00
2024-01-19 13:50:27 +03:00
from pathlib import PosixPath
2020-03-28 04:51:28 +03:00
import pytest
from PIL import Image
2018-03-03 12:54:00 +03:00
2024-01-19 13:50:27 +03:00
def test_j2k_overflow(tmp_path: PosixPath) -> None:
2020-03-28 04:51:28 +03:00
im = Image.new("RGBA", (1024, 131584))
target = str(tmp_path / "temp.jpc")
with pytest.raises(OSError):
2020-03-28 04:51:28 +03:00
im.save(target)