Skip to content

feat: errors for truncated PAA and ODOL files, PNGs and unknown types - #49

Merged
TheWillard merged 1 commit into
mainfrom
feat/paa-odol-garbage-errors
Nov 7, 2026
Merged

TheWillard merged 1 commit into
mainfrom
feat/paa-odol-garbage-errors

Conversation

@TheWillard

@TheWillard TheWillard commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Decoy files of obfuscated PBOs and some broken mod files failed with errors that don't say what's wrong: I/O errors at the end of the file, LZO errors from garbage, or enum mismatches. Now:

  • PaaError::MipmapPastEnd: a texture whose mipmaps reach past the end of the file. All mipmap headers are read before any data is decoded, so a truncated texture fails as that, not on the garbage in the mipmaps it does have.
  • OdolError::LodPastEnd: a model whose LODs start past the end of the file. Checked before the LODs are read, also for OdolLazyReader. Only start addresses: the end addresses of some small models that load fine (Blastcore particle effects) are past the end of the file.
  • PaaError::Png: a PNG image with a .paa name (found in niarsenal).
  • PaaError::UnknownType: an unknown PAA type. These read as zero mipmaps before, or failed later.
  • Tagg::read grows with the data instead of allocating its stored size, up to 4 GB for garbage.

Checked against Arma 3 (6,682 models, 20,817 textures) and 150 mods (~28,000 models, ~320,000 textures):

  • Arma 3 reads the same as before.
  • Mods: everything that loaded still loads, except one RHSTERRACORE texture that starts with zeros instead of a header: it read as zero mipmaps, now UnknownType(0).
  • 98,011 of the 99,889 failing mod textures fail with MipmapPastEnd, and 3,085 of the 5,496 failing models with LodPastEnd. The rest are garbage within the file and keep their errors.

Based on #48.

Base automatically changed from fix/paa-mipmap-size-wrap to main November 6, 2026 23:25
Decoy files of obfuscated PBOs are cut-off copies of real files. They
failed with I/O errors at the end of the file or errors from the
garbage they contain.

- PaaError::MipmapPastEnd: mipmaps reaching past the end of the file.
  All headers are read before any mipmap is decoded.
- OdolError::LodPastEnd: LODs starting past the end of the file,
  checked before reading them (also for OdolLazyReader). End addresses
  of some small models that load fine are past the end of the file.
- PaaError::Png for PNG images with a .paa name, PaaError::UnknownType
  for other unknown types, which read as zero mipmaps before.
- Tagg::read grows with the data instead of allocating its stored size.
@TheWillard
TheWillard force-pushed the feat/paa-odol-garbage-errors branch from c98ebc4 to 6d9d6d6 Compare November 6, 2026 23:27
@codecov

codecov Bot commented Nov 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.56098% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
arma-file-formats/src/real_virtuality/paa/tagg.rs 80.00% 1 Missing ⚠️
Files with missing lines Coverage Δ
arma-file-formats/src/real_virtuality/p3d/odol.rs 57.14% <100.00%> (+8.36%) ⬆️
arma-file-formats/src/real_virtuality/paa/paa.rs 97.74% <100.00%> (+0.14%) ⬆️
arma-file-formats/src/real_virtuality/paa/tagg.rs 95.45% <80.00%> (-4.55%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@TheWillard
TheWillard merged commit bf1dfdc into main Nov 7, 2026
2 checks passed
@TheWillard
TheWillard deleted the feat/paa-odol-garbage-errors branch November 7, 2026 01:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant