mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-02-02 19:01:04 +00:00
fix(core): fix display_icon function - incorrect boundaries checks
This commit is contained in:
parent
f7a3aad9bd
commit
0e778cf16d
@ -386,8 +386,8 @@ void display_icon(int x, int y, int w, int h, const void *data,
|
||||
int st = uzlib_uncompress(&decomp);
|
||||
if (st == TINF_DONE) break; // all OK
|
||||
if (st < 0) break; // error
|
||||
const int px = pos % w;
|
||||
const int py = pos / w;
|
||||
const int px = (pos * 2) % w;
|
||||
const int py = (pos * 2) / w;
|
||||
if (px >= x0 && px <= x1 && py >= y0 && py <= y1) {
|
||||
PIXELDATA(colortable[decomp_out >> 4]);
|
||||
PIXELDATA(colortable[decomp_out & 0x0F]);
|
||||
|
Loading…
Reference in New Issue
Block a user