gdiplus: Don't require specific gdi+ versions in metafile structures.
Based on testing of manually edited metafiles, only the signature portion of version fields are tested, not the version number. Signed-off-by: Vincent Povirk <vincent@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
88abcf3a1d
commit
cfe2b3fa0e
|
@ -41,6 +41,7 @@
|
|||
|
||||
#define VERSION_MAGIC 0xdbc01001
|
||||
#define VERSION_MAGIC2 0xdbc01002
|
||||
#define VALID_MAGIC(x) (((x) & 0xfffff000) == 0xdbc01000)
|
||||
#define TENSION_CONST (0.3)
|
||||
|
||||
#define GIF_DISPOSE_UNSPECIFIED 0
|
||||
|
|
|
@ -961,7 +961,7 @@ static GpStatus read_element(struct memory_buffer *mbuf, GpRegion *region, regio
|
|||
ERR("failed to read path header\n");
|
||||
return InvalidParameter;
|
||||
}
|
||||
if (path_header->magic != VERSION_MAGIC)
|
||||
if (!VALID_MAGIC(path_header->magic))
|
||||
{
|
||||
ERR("invalid path header magic %#x\n", path_header->magic);
|
||||
return InvalidParameter;
|
||||
|
@ -1069,8 +1069,7 @@ GpStatus WINGDIPAPI GdipCreateRegionRgnData(GDIPCONST BYTE *data, INT size, GpRe
|
|||
init_memory_buffer(&mbuf, data, size);
|
||||
|
||||
region_header = buffer_read(&mbuf, sizeof(*region_header));
|
||||
if (!region_header || (region_header->magic != VERSION_MAGIC &&
|
||||
region_header->magic != VERSION_MAGIC2))
|
||||
if (!region_header || !VALID_MAGIC(region_header->magic))
|
||||
return InvalidParameter;
|
||||
|
||||
status = GdipCreateRegion(region);
|
||||
|
|
Loading…
Reference in New Issue