Commit 4bca12c0 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

gdiplus: Slightly simplify write_path_types.

parent db521d5c
......@@ -702,14 +702,15 @@ static inline void write_packed_point(DWORD* location, INT* offset,
static inline void write_path_types(DWORD* location, INT* offset,
const GpPath* path)
{
INT rounded_size = get_pathtypes_size(path);
memcpy(location + *offset, path->pathdata.Types, path->pathdata.Count);
/* The unwritten parts of the DWORD (if any) must be cleared */
if (path->pathdata.Count % sizeof(DWORD))
if (rounded_size - path->pathdata.Count)
ZeroMemory(((BYTE*)location) + (*offset * sizeof(DWORD)) +
path->pathdata.Count,
sizeof(DWORD) - path->pathdata.Count % sizeof(DWORD));
*offset += (get_pathtypes_size(path) / sizeof(DWORD));
path->pathdata.Count, rounded_size - path->pathdata.Count);
*offset += rounded_size / sizeof(DWORD);
}
static void write_element(const region_element* element, DWORD *buffer,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment