Henri Verbeet : wined3d: Use FIELD_OFFSET to calculate the size in surface_create_dib_section().
Alexandre Julliard
julliard at wine.codeweavers.com
Mon Feb 15 09:41:48 CST 2016
Module: wine
Branch: master
Commit: 649d2dfb3b7ccfa689eb9fbce2f094fe5c03c738
URL: http://source.winehq.org/git/wine.git/?a=commit;h=649d2dfb3b7ccfa689eb9fbce2f094fe5c03c738
Author: Henri Verbeet <hverbeet at codeweavers.com>
Date: Fri Feb 12 18:52:20 2016 +0100
wined3d: Use FIELD_OFFSET to calculate the size in surface_create_dib_section().
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/wined3d/surface.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 459cbdc..0e6bf28 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -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;
}
More information about the wine-cvs
mailing list