From 8b9cff6e7083042e46ee28cffa89a97c53d3a9a6 Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Thu, 14 May 2020 20:51:10 -0500 Subject: [PATCH] gdiplus: Return an error retrieving the palette for a metafile. Signed-off-by: Vincent Povirk Signed-off-by: Alexandre Julliard --- dlls/gdiplus/image.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index 17cccf2b427..cafe69d8f43 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -2285,6 +2285,12 @@ GpStatus WINGDIPAPI GdipGetImagePaletteSize(GpImage *image, INT *size) if(!image || !size) return InvalidParameter; + if (image->type == ImageTypeMetafile) + { + *size = 0; + return GenericError; + } + if (!image->palette || image->palette->Count == 0) *size = sizeof(ColorPalette); else