Skip to content

Commit 6ec7c0c

Browse files
committed
add workaround for CreateDIBSection offset bug
1 parent 2c2fd7f commit 6ec7c0c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ddsurface.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1553,7 +1553,7 @@ 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;
1556+
DWORD map_offset = 65280; // CreateDIBSection cannot handle values higher than a WORD - 0xFF00 (guard lines);
15571557

15581558
dst_surface->mapping =
15591559
CreateFileMappingA(

0 commit comments

Comments
 (0)