Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wrong display of some image files when BPP is not properly set in area #506

Merged
merged 1 commit into from
Jul 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/bolos/nbgl.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ unsigned long sys_nbgl_front_draw_img_file(nbgl_area_t *area, uint8_t *buffer,
}
size_t len = sizeof(nbgl_area_t) + 1;
size_t buffer_len = 0;

// force area bpp with the value from "file" to avoid some issues
area->bpp = (buffer[4] >> 4) & 0xF;

switch (compressed) {
case 0: // no compression
buffer_len = (area->width * area->height * (area->bpp + 1)) / 8;
Expand Down
Loading