mirror of
https://github.com/reactos/wine.git
synced 2025-03-06 03:37:28 +00:00
wined3d: Use FIELD_OFFSET to calculate the size in surface_create_dib_section().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
0f8a0fd400
commit
649d2dfb3b
@ -379,17 +379,17 @@ HRESULT surface_create_dib_section(struct wined3d_surface *surface)
|
||||
case 2:
|
||||
case 4:
|
||||
/* Allocate extra space to store the RGB bit masks. */
|
||||
b_info = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(BITMAPINFOHEADER) + 3 * sizeof(DWORD));
|
||||
b_info = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, FIELD_OFFSET(BITMAPINFO, bmiColors[3]));
|
||||
break;
|
||||
|
||||
case 3:
|
||||
b_info = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(BITMAPINFOHEADER));
|
||||
b_info = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, FIELD_OFFSET(BITMAPINFO, bmiColors[0]));
|
||||
break;
|
||||
|
||||
default:
|
||||
/* Allocate extra space for a palette. */
|
||||
b_info = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
|
||||
sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD) * (1u << (format->byte_count * 8)));
|
||||
FIELD_OFFSET(BITMAPINFO, bmiColors[1u << (format->byte_count * 8)]));
|
||||
break;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user