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
288 B
Python
Raw Permalink Normal View History

from __future__ import annotations
2024-01-20 14:23:03 +03:00
2024-01-23 13:42:36 +03:00
from pathlib import Path
2020-03-28 04:51:28 +03:00
import pytest
from PIL import Image
2018-03-03 12:54:00 +03:00
2024-01-23 13:42:36 +03:00
def test_j2k_overflow(tmp_path: Path) -> 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)