Repository navigation
Clip GIF playback frames to logical screen - #183
Merged
Merged
Conversation
haobinnan
pushed a commit
to haobinnan/FreeImage
that referenced
this pull request
Oct 31, 2026
The CNA published IDs for the IFF PBM RLE overflow fixed in 3.19.22 (danoli3#156, danoli3#161) and the GIF_PLAYBACK compositing overflow fixed in 3.19.25 (danoli3#183). Credit the reporters, and note that 3.19.25 only added a RAS regression test: the RAS fix shipped in 3.19.14 (d474400) under CVE-2024-28578 and CVE-2024-28580.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The GIF playback path composites frame rectangles onto the logical-screen canvas without clipping their horizontal bounds. A frame whose
left + widthextends past the canvas can write beyond the destination row. The disposal-background path has the same issue. This change clips both frame paths to the logical screen while keeping valid in-bounds pixels unchanged.The other two findings in the report are already fixed on
master: RAS loop counters and allocation sizing were fixed in d474400, and PBM RLE bounds/short-read handling were fixed in #161 and #162.Adds crafted regression cases for a partially off-screen GIF frame, a far-off-screen frame, its disposal clear, and a 70,000-pixel RAS row.
Validation: the ASan build passes all 9 TestAPI tests. The GIF case reports a heap-buffer-overflow in
GifPlaybackCompositeFrameon the unfixedorigin/masterbaseline; the RAS case reports a heap-buffer-overflow on report commit625117b; the IFF RLE regression case also reports a heap-buffer-overflow on625117b. The current fixed build passes all three cases.