Avoid out-of-bounds palette read in 8bpp BMP decoder (PR #26439)

8 views
Skip to first unread message

MarkLee131

unread,
May 10, 2026, 6:01:08 PM (4 days ago) May 10
to wx-...@googlegroups.com, Subscribed

Fix #26438:
The non-RLE 8bpp branch at imagbmp.cpp:903, plus the RLE absolute and RLE encoded branches a few lines above, all index cmap[aByte] without checking aByte against the palette colour count. A BMP that pairs a small palette with a colour-index byte >= ncolors reads past the palette and the value flows into the decoded pixel.

Reject the file (return false) at each site, matching the surrounding "return false on malformed input" pattern.


You can view, comment on, or merge this pull request online at:

  https://github.com/wxWidgets/wxWidgets/pull/26439

Commit Summary

  • 2b43d38 Avoid out-of-bounds palette read in 8bpp BMP decoder

File Changes

(2 files)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26439@github.com>

VZ

unread,
May 10, 2026, 6:29:19 PM (4 days ago) May 10
to wx-...@googlegroups.com, Subscribed

@vadz approved this pull request.

Thanks again for the PR and the detailed explanations, I'll merge this one soon!


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26439/review/4259999948@github.com>

VZ

unread,
May 10, 2026, 7:29:49 PM (4 days ago) May 10
to wx-...@googlegroups.com, Subscribed

Closed #26439 via b305cb4.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26439/issue_event/25360562597@github.com>

Reply all
Reply to author
Forward
0 new messages