From 1235a9056c8324c5552f739114343b3e91dc15fb Mon Sep 17 00:00:00 2001 From: Joel Bodenmann Date: Thu, 26 Aug 2021 00:04:47 +0200 Subject: [PATCH] Win32 driver: Fix buffer position calculation in gdisp_lld_blit_area() Thanks to @nathanwiebe for reporting this. --- changelog.txt | 1 + drivers/multiple/Win32/gdisp_lld_Win32.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/changelog.txt b/changelog.txt index 034be8d3..c5b373ba 100644 --- a/changelog.txt +++ b/changelog.txt @@ -18,6 +18,7 @@ CHANGE: STM32LTDC driver: Rename GDISP_LTDC_USE_RGB565 to STM32LTDC_USE_RGB5 FEATURE: STM32LTDC driver: Support double buffering. This introduces STM32LTDC_USE_DOUBLEBUFFERING. FIX: STM32LTDC driver: Fix bug in gdisp_lld_blit_area() which affected blits with source coordinates other than (0, 0). FIX: Improve /demos/benchmarks/rectangles. +FIX: Win32 driver: Fix buffer position calculation in gdisp_lld_blit_area(). *** Release 2.9 *** diff --git a/drivers/multiple/Win32/gdisp_lld_Win32.c b/drivers/multiple/Win32/gdisp_lld_Win32.c index 5b1390e7..09644a59 100644 --- a/drivers/multiple/Win32/gdisp_lld_Win32.c +++ b/drivers/multiple/Win32/gdisp_lld_Win32.c @@ -1283,7 +1283,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { // Make everything relative to the start of the line priv = g->priv; buffer = g->p.ptr; - buffer += g->p.x2*g->p.y1; + buffer += g->p.x2 * g->p.y1 + g->p.x1; memset(&bmpInfo, 0, sizeof(bmpInfo)); bmpInfo.bV4Size = sizeof(bmpInfo);