[PR #7766] PNG checksums: shader pack textures too, and the bad-IHDR case pinned #7806

Open
opened 2026-11-03 07:24:24 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7766
Author: @xFedeT
Created: 11/2/2026
Status: 🔄 Open

Base: main ← Head: fix/png-bad-crc


📝 Commits (1)

  • 9d51225 Shader pack textures decode PNGs with wrong chunk checksums; pin the bad-IHDR case

📊 Changes

2 files changed (+39 additions, -0 deletions)

View changed files

📝 crates/horizon-client-render/src/hud.rs (+18 -0)
📝 crates/horizon-shaders/src/textures.rs (+21 -0)

📄 Description

🤖 Opened by xFedeT's AI agent (Claude Code, Sonnet 5.5), not by xFedeT personally.

Fixes #7764

The reported errors (CRC error ... IHDR, font sheet ... could not be read) come from PNGs whose chunk checksums are wrong, as a server's obfuscated pack ships them. 065e7b8ef already made the game's pack decoders (hud::decode_bytes, sprites, biome) ignore checksums, as stb_image does; it landed after the reporter's nightly (c9d474d), so their next nightly has it.

This PR closes what is left:

  • horizon-shaders decode_png (a shader pack's own textures) refused such a PNG: it ignores checksums now.
  • Tests pin the exact case of the report, a corrupted IHDR CRC (the existing test corrupts an IDAT's): decode_bytes_ignores_a_bad_ihdr_checksum in hud.rs (passes on main already) and a_png_with_a_wrong_header_checksum_decodes in horizon-shaders.

I did not join a server with such a pack; cargo test -p horizon-client-render --lib decode_bytes, cargo test -p horizon-shaders --lib wrong_header.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/7766 **Author:** [@xFedeT](https://github.com/xFedeT) **Created:** 11/2/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/png-bad-crc` --- ### 📝 Commits (1) - [`9d51225`](https://github.com/horizon-rust/horizon/commit/9d51225eb768f056a8ec8f122972c33bd90a8875) Shader pack textures decode PNGs with wrong chunk checksums; pin the bad-IHDR case ### 📊 Changes **2 files changed** (+39 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/hud.rs` (+18 -0) 📝 `crates/horizon-shaders/src/textures.rs` (+21 -0) </details> ### 📄 Description > 🤖 Opened by xFedeT's AI agent (Claude Code, Sonnet 5.5), not by xFedeT personally. Fixes #7764 The reported errors (`CRC error ... IHDR`, `font sheet ... could not be read`) come from PNGs whose chunk checksums are wrong, as a server's obfuscated pack ships them. `065e7b8ef` already made the game's pack decoders (`hud::decode_bytes`, sprites, biome) ignore checksums, as stb_image does; it landed after the reporter's nightly (c9d474d), so their next nightly has it. This PR closes what is left: - `horizon-shaders` `decode_png` (a shader pack's own textures) refused such a PNG: it ignores checksums now. - Tests pin the exact case of the report, a corrupted **IHDR** CRC (the existing test corrupts an IDAT's): `decode_bytes_ignores_a_bad_ihdr_checksum` in `hud.rs` (passes on main already) and `a_png_with_a_wrong_header_checksum_decodes` in `horizon-shaders`. I did not join a server with such a pack; `cargo test -p horizon-client-render --lib decode_bytes`, `cargo test -p horizon-shaders --lib wrong_header`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#7806
No description provided.