Skip to content

Commit 14336e8

Browse files
committed
add guard lines on both on top and bottom of the buffer
1 parent 30e6010 commit 14336e8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/ddsurface.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1553,17 +1553,17 @@ HRESULT dd_CreateSurface(
15531553
if (dst_surface->hdc)
15541554
InterlockedIncrement(&g_dds_gdi_handles);
15551555

1556+
DWORD map_offset = dst_surface->pitch * g_config.guard_lines;
1557+
15561558
dst_surface->mapping =
15571559
CreateFileMappingA(
15581560
INVALID_HANDLE_VALUE,
15591561
NULL,
15601562
PAGE_READWRITE | SEC_COMMIT,
15611563
0,
1562-
bmp_size + 256,
1564+
bmp_size + 256 + map_offset,
15631565
NULL);
15641566

1565-
DWORD map_offset = 0;
1566-
15671567
if (dst_surface->mapping)
15681568
{
15691569
LPVOID data = MapViewOfFile(dst_surface->mapping, FILE_MAP_ALL_ACCESS, 0, 0, 0);

0 commit comments

Comments
 (0)