File: check_j2k_overflow.py

package info (click to toggle)
pillow 8.1.2%2Bdfsg-0.3%2Bdeb11u2
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 65,628 kB
  • sloc: python: 35,630; ansic: 31,009; makefile: 388; javascript: 114; sh: 77
file content (10 lines) | stat: -rw-r--r-- 212 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
import pytest

from PIL import Image


def test_j2k_overflow(tmp_path):
    im = Image.new("RGBA", (1024, 131584))
    target = str(tmp_path / "temp.jpc")
    with pytest.raises(OSError):
        im.save(target)