Skip to content

Commit

Permalink
Fix wrong display of some image files when BPP is not properly set in…
Browse files Browse the repository at this point in the history
… area
  • Loading branch information
nroggeman-ledger committed Jul 12, 2024
1 parent 836624d commit 700d876
Showing 1 changed file with 4 additions and 0 deletions.
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

0 comments on commit 700d876

Please sign in to comment.