Skip to content

Add malformed-input regression tests for LAC and WAV parsers #11

Description

@audexdev

Summary

Current tests cover happy-path roundtrips and a few top-level decoder errors, but malformed parser/decoder coverage is shallow. We need targeted regression tests for corrupted WAV and LAC structures.

Affected areas

  • tests/test_e2e.cpp
  • tests/test_zerorun.cpp
  • new malformed-input test files if useful

Test cases to add

WAV:

  • truncated RIFF header
  • truncated chunk-size field
  • fmt chunk smaller than 16 bytes
  • data before fmt
  • invalid byte_rate and block_align
  • oversized declared data chunk with short payload
  • odd-sized unknown chunks and padding

LAC/container/block:

  • invalid block count
  • oversized block table
  • truncated block payload
  • invalid per-block stereo flag
  • unsupported predictor orders
  • invalid residual modes and reserved tags
  • zero-run overflow beyond partition size
  • trailing bytes after a valid stream

Acceptance criteria

  • Each malformed fixture fails deterministically without crashes or excessive allocation.
  • Tests do not require large binary files in the repository.
  • Tests can run in CI without the ignored local assets/ directory.

Metadata

Metadata

Assignees

No one assigned

    Labels

    hardeningInput validation and robustness hardeningsecuritySecurity-relevant parser, decoder, or memory-safety worktestingTest coverage, fixtures, and regression cases

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions