Skip to content

Commit 33f2b91

Browse files
committed
tweak workaound for CreateDIBSection offset bug
1 parent 6ec7c0c commit 33f2b91

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/ddsurface.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1553,7 +1553,8 @@ HRESULT dd_CreateSurface(
15531553
if (dst_surface->hdc)
15541554
InterlockedIncrement(&g_dds_gdi_handles);
15551555

1556-
DWORD map_offset = 65280; // CreateDIBSection cannot handle values higher than a WORD - 0xFF00 (guard lines);
1556+
// CreateDIBSection cannot handle values higher than a WORD - 0xFF00 (guard lines);
1557+
DWORD map_offset = min(65280, dst_surface->pitch * g_config.guard_lines);
15571558

15581559
dst_surface->mapping =
15591560
CreateFileMappingA(

0 commit comments

Comments
 (0)