Pillow/Tests/check_j2k_overflow.py
2024-01-19 21:50:27 +11:00

13 lines
296 B
Python

from __future__ import annotations
from pathlib import PosixPath
import pytest
from PIL import Image
def test_j2k_overflow(tmp_path: PosixPath) -> None:
im = Image.new("RGBA", (1024, 131584))
target = str(tmp_path / "temp.jpc")
with pytest.raises(OSError):
im.save(target)