()
| 492 | |
| 493 | |
| 494 | def test_image_decoder_crafted_tiny_files(): |
| 495 | with tempfile.TemporaryDirectory() as tmpdir: |
| 496 | tiny_file_path = os.path.join(tmpdir, "tiny.img") |
| 497 | with open(tiny_file_path, "wb") as f: |
| 498 | f.write(b"\xff") |
| 499 | |
| 500 | @pipeline_def(batch_size=2, device_id=0, num_threads=1) |
| 501 | def pipe(): |
| 502 | encoded, _ = fn.readers.file(files=[tiny_file_path]) |
| 503 | decoded = fn.decoders.image(encoded, device="cpu", output_type=types.RGB) |
| 504 | return decoded |
| 505 | |
| 506 | p = pipe() |
| 507 | assert_raises(RuntimeError, p.run) |
| 508 | |
| 509 | |
| 510 | # Regression test for the nvImageCodec ROI/orientation contract bug. For EXIF |
nothing calls this directly
no test coverage detected