mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-14 06:42:58 +08:00
fix(draw): fix set_px_cb memory write overflow crash. (#2882)
This commit is contained in:
parent
43729d1502
commit
e50950683d
@ -420,8 +420,6 @@ static void map_set_px(lv_color_t * dest_buf, lv_coord_t dest_stride, const lv_a
|
||||
|
||||
int32_t src_stride = lv_area_get_width(src_area);
|
||||
|
||||
dest_buf += dest_stride * clip_area->y1 + clip_area->x1;
|
||||
|
||||
src_buf += src_stride * (clip_area->y1 - src_area->y1);
|
||||
src_buf += (clip_area->x1 - src_area->x1);
|
||||
|
||||
@ -430,7 +428,7 @@ static void map_set_px(lv_color_t * dest_buf, lv_coord_t dest_stride, const lv_a
|
||||
|
||||
if(mask == NULL) {
|
||||
for(y = 0; y < clip_h; y++) {
|
||||
for(x = 0; x <= clip_w; x++) {
|
||||
for(x = 0; x < clip_w; x++) {
|
||||
disp->driver->set_px_cb(disp->driver, (void *)dest_buf, dest_stride, clip_area->x1 + x, clip_area->y1 + y, src_buf[x],
|
||||
opa);
|
||||
}
|
||||
@ -439,7 +437,7 @@ static void map_set_px(lv_color_t * dest_buf, lv_coord_t dest_stride, const lv_a
|
||||
}
|
||||
else {
|
||||
for(y = 0; y < clip_h; y++) {
|
||||
for(x = 0; x <= clip_w; x++) {
|
||||
for(x = 0; x < clip_w; x++) {
|
||||
if(mask[x]) {
|
||||
disp->driver->set_px_cb(disp->driver, (void *)dest_buf, dest_stride, clip_area->x1 + x, clip_area->y1 + y, src_buf[x],
|
||||
(uint32_t)((uint32_t)opa * mask[x]) >> 8);
|
||||
|
Loading…
x
Reference in New Issue
Block a user