Repository navigation
fix(gui): harden bitmap allocation and filename decoding - #7975
Open
thomaskistler wants to merge 2 commits into
Open
thomaskistler wants to merge 2 commits into
thomaskistler wants to merge 2 commits into
Conversation
This was referenced Nov 2, 2026
Guard BitmapBuffer allocation arithmetic and null storage bounds. Reject filename images outside LVGL descriptor limits and preserve grayscale-alpha PNG pixels in the STB filename decoder. Add dedicated buffer and decoder regression coverage with temporary fixture cleanup. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Include allocation limits explicitly and keep the filename descriptor limit local to the decoder. Test allocation and storage bounds without invoking image resizing, retaining the existing resize API unchanged. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
thomaskistler
force-pushed
the
thomaskistler/bitmap-decoder-cleanup
branch
from
November 3, 2026 06:02
9f7e67e to
255895a
Compare
This branch has not been deployed
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.
Fixes: N/A
Summary of changes
BitmapBufferallocations and compute null-safe,size_tstorage bounds in both constructors andsetData().This is an independent fix against
main, with no prerequisite PRs. It changes only the general allocation code inbitmapbuffer.cpp, the existing filename decoder inbitmapbuffer_fileio.cpp, and dedicated tests inradio/src/tests/bitmapbuffer.cpp.The allocation code includes
<limits>explicitly, and the filename decoder keeps its dimension limit local. The existingBitmapBufferheader,resizeToLVGL()API/implementation, andloadBitmap()behavior are unchanged. No Lua hardening orlvgl.bitmapfeature changes are included.Validation
cmake --build build/native --target gtests-radio --parallel 6: passed.build/native/gtests-radio --gtest_filter='BitmapBuffer.*:BitmapFilenameDecoder.*': 7/7 passed.build/native/gtests-radio: 250/250 passed.DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib build/native/gtests-radio --gtest_filter='BitmapBuffer.*:BitmapFilenameDecoder.*:Lua*:Lcd*:MainWindow.*': 35/35 passed with GuardMalloc loaded.build/native/gtests-radio --gtest_filter='BitmapBuffer.*:BitmapFilenameDecoder.*:Lua*:Lcd*:MainWindow.*' --gtest_shuffle --gtest_repeat=10 --gtest_random_seed=41827: all ten 35-test iterations passed.Temporary decoder fixtures were removed after validation.
Not performed: ARM firmware or Companion builds, hardware performance measurements, or radio heap measurements.