Zhiyi Zhang : gdiplus: Fix a possible NULL pointer reference in GdipGetNearestColor().

Alexandre Julliard julliard at winehq.org
Mon Feb 24 15:23:53 CST 2020


Module: wine
Branch: master
Commit: 83e95a609c8ee598ddd8f1054974689e47e5168b
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=83e95a609c8ee598ddd8f1054974689e47e5168b

Author: Zhiyi Zhang <zzhang at codeweavers.com>
Date:   Mon Feb 24 11:06:16 2020 +0800

gdiplus: Fix a possible NULL pointer reference in GdipGetNearestColor().

Fix a regression from 5ca9da2c0197ac1260975c1b7b643dbd11185715.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48657
Signed-off-by: Zhiyi Zhang <zzhang at codeweavers.com>
Signed-off-by: Vincent Povirk <vincent at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/gdiplus/graphics.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index e8606f6b60..af95c7aeea 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -4783,7 +4783,7 @@ GpStatus WINGDIPAPI GdipGetNearestColor(GpGraphics *graphics, ARGB* argb)
     if(graphics->busy)
         return ObjectBusy;
 
-    if (graphics->image->type == ImageTypeBitmap)
+    if (graphics->image && graphics->image->type == ImageTypeBitmap)
     {
         static int once;
         GpBitmap *bitmap = (GpBitmap *)graphics->image;




More information about the wine-cvs mailing list