fix: reject undecodable JPEG without tables or with a bad scan header

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-30 03:23:00 +03:00
co-authored by Claude Opus 5.5
parent e30b6496f1
commit 844306d5cb
9 changed files with 576 additions and 46 deletions
+20
View File
@@ -298,6 +298,26 @@ def test_damaged_png_data(
)
@pytest.mark.spec("attachments", "Недекодируемый JPEG")
def test_undecodable_jpeg(
api: Api,
alice: Actor,
chat: dict[str, Any],
) -> None:
assert_errors(
{
name: api.post_attachment(
alice,
chat["id"],
data,
content_type="image/jpeg",
)
for name, data in images.jpeg_undecodable().items()
},
415,
)
@pytest.mark.spec("attachments", "Хвост после конца изображения")
def test_tail_after_end(
api: Api,