Skip to content

Fix DecodeIFF CMAP palette bounds check#126

Merged
segrax merged 1 commit into
masterfrom
codex/fix-palette-size-access-issue
May 24, 2026
Merged

Fix DecodeIFF CMAP palette bounds check#126
segrax merged 1 commit into
masterfrom
codex/fix-palette-size-access-issue

Conversation

@segrax
Copy link
Copy Markdown
Member

@segrax segrax commented May 24, 2026

Motivation

  • Prevent an invalid .size() call and avoid a magic-number bound when writing CMAP entries in cGraphics_Amiga::DecodeIFF, ensuring the palette write guard matches the actual mPalette storage.

Description

  • Replace the hard-coded check if (i < 256) with if (i < std::size(Result.mPalette)) in cGraphics_Amiga::DecodeIFF to correctly guard CMAP palette writes.

Testing

  • Ran git diff --check to validate the patch formatting and found no issues (succeeded).

Codex Task

@segrax segrax merged commit fa63fbd into master May 24, 2026
0 of 6 checks passed
@segrax segrax deleted the codex/fix-palette-size-access-issue branch May 24, 2026 02:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant