Skip to content

Fix gif decoder bug - #9520

Merged
NicolasHug merged 2 commits into
pytorch:mainfrom
NicolasHug:fix-gif-bug
Jun 22, 2026
Merged

NicolasHug merged 2 commits into
pytorch:mainfrom
NicolasHug:fix-gif-bug

Conversation

@NicolasHug

Copy link
Copy Markdown
Member

Fix bug on malformed gif where we would potentially try to write outside of the allocated tensor's memory

@NicolasHug NicolasHug added the bug label Jun 22, 2026
@pytorch-bot

pytorch-bot Bot commented Jun 22, 2026

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/vision/9520

Note: Links to docs will display an error until the docs builds have been completed.

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the cla signed label Jun 22, 2026
if (c == gcb.TransparentColor) {
continue;
}
GifColorType rgb = cmap->Colors[c];

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(this may be nitpicky)

Should c be checked against cmap->ColorCount here? A malformed GIF could have pixel indices exceeding the palette size, which would be a heap OOB read?

robert-bell pushed a commit to opendatahub-io/torchvision that referenced this pull request Sep 18, 2026
(cherry picked from commit 4e05dc2)
Signed-off-by: Rob Bell <[email protected]>
robert-bell pushed a commit to opendatahub-io/torchvision that referenced this pull request Sep 18, 2026
(cherry picked from commit 4e05dc2)
Signed-off-by: Rob Bell <[email protected]>
robert-bell pushed a commit to opendatahub-io/torchvision that referenced this pull request Sep 21, 2026
(cherry picked from commit 4e05dc2)
Signed-off-by: Rob Bell <[email protected]>
robert-bell pushed a commit to opendatahub-io/torchvision that referenced this pull request Sep 21, 2026
(cherry picked from commit 4e05dc2)
Signed-off-by: Rob Bell <[email protected]>
robert-bell pushed a commit to opendatahub-io/torchvision that referenced this pull request Sep 21, 2026
(cherry picked from commit 4e05dc2)
Signed-off-by: Rob Bell <[email protected]>
robert-bell pushed a commit to opendatahub-io/torchvision that referenced this pull request Sep 21, 2026
(cherry picked from commit 4e05dc2)
Signed-off-by: Rob Bell <[email protected]>
robert-bell pushed a commit to opendatahub-io/torchvision that referenced this pull request Sep 21, 2026
(cherry picked from commit 4e05dc2)
Signed-off-by: Rob Bell <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants