Skip to content

Fix GIF background color index bounds#570

Merged
treeform merged 1 commit intomasterfrom
fix/gif-bgcolor-index-bounds
Apr 30, 2026
Merged

Fix GIF background color index bounds#570
treeform merged 1 commit intomasterfrom
fix/gif-bgcolor-index-bounds

Conversation

@treeform
Copy link
Copy Markdown
Owner

Fixes #560.

Summary:

  • Reject GIF background color indexes that are equal to the global color table size before indexing the table.
  • Add a regression test using a crafted GIF with a two-entry global color table and bgColorIndex == 2.

Tests:

  • nim r --hints:off --warnings:off tests\test_gif.nim
  • nim r --hints:off --warnings:off tests\tests.nim
  • git diff --check HEAD~1..HEAD

@treeform treeform merged commit 31c54e3 into master Apr 30, 2026
3 checks passed
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.

Off-by-one in GIF parsing

1 participant