Skip to content

Use unsigned atom sizes and counts - #12

Merged
snowskeleton merged 1 commit into
snowskeleton:mainfrom
seedds:fix-unsigned-atom-sizes
Jun 1, 2026
Merged

Use unsigned atom sizes and counts#12
snowskeleton merged 1 commit into
snowskeleton:mainfrom
seedds:fix-unsigned-atom-sizes

Conversation

@seedds

@seedds seedds commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • parse MP4 atom sizes as unsigned 32/64-bit values
  • parse AAVD sample lengths and MDAT count/length fields as unsigned values
  • preserve signed reads for FourCC/tag fields only

Why

Large .aaxc files can contain mdat atoms larger than 2 GiB. Reading those sizes as signed integers turns values like 0x8f3354dd into negative numbers, which later triggers ValueError: read length must be non-negative or -1 during decryption.

Verification

  • python3 -m py_compile src/snowcrypt/snowcrypt.py
  • validated the patched parser reads a failing file's top-level mdat size as 2402505949 instead of a negative value
  • validated the same patch in the installed package by successfully decrypting a previously failing 2.4 GB .aaxc file end-to-end

@snowskeleton
snowskeleton merged commit 7c2f425 into snowskeleton:main Jun 1, 2026
4 checks passed
@snowskeleton

Copy link
Copy Markdown
Owner

Thanks for the PR! This also probably fixes #5

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.

2 participants