Piotr Caban : winemac: Handle dummy_surface in get_mac_surface.
Alexandre Julliard
julliard at winehq.org
Wed Mar 11 17:38:32 CDT 2020
Module: wine
Branch: master
Commit: da1e666f57c61f68c77debd6b9ba9aebe0545b85
URL: https://source.winehq.org/git/wine.git/?a=commit;h=da1e666f57c61f68c77debd6b9ba9aebe0545b85
Author: Piotr Caban <piotr at codeweavers.com>
Date: Wed Mar 11 14:45:54 2020 -0500
winemac: Handle dummy_surface in get_mac_surface.
Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Ken Thomases <ken at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/winemac.drv/surface.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/dlls/winemac.drv/surface.c b/dlls/winemac.drv/surface.c
index 9850c92aaa..85ff56c957 100644
--- a/dlls/winemac.drv/surface.c
+++ b/dlls/winemac.drv/surface.c
@@ -70,10 +70,7 @@ struct macdrv_window_surface
BITMAPINFO info; /* variable size, must be last */
};
-static struct macdrv_window_surface *get_mac_surface(struct window_surface *surface)
-{
- return (struct macdrv_window_surface *)surface;
-}
+static struct macdrv_window_surface *get_mac_surface(struct window_surface *surface);
/***********************************************************************
* update_blit_data
@@ -227,6 +224,12 @@ static const struct window_surface_funcs macdrv_surface_funcs =
macdrv_surface_destroy,
};
+static struct macdrv_window_surface *get_mac_surface(struct window_surface *surface)
+{
+ if (!surface || surface->funcs != &macdrv_surface_funcs) return NULL;
+ return (struct macdrv_window_surface *)surface;
+}
+
/***********************************************************************
* create_surface
*/
@@ -311,7 +314,7 @@ failed:
void set_surface_use_alpha(struct window_surface *window_surface, BOOL use_alpha)
{
struct macdrv_window_surface *surface = get_mac_surface(window_surface);
- surface->use_alpha = use_alpha;
+ if (surface) surface->use_alpha = use_alpha;
}
/***********************************************************************
@@ -424,6 +427,7 @@ void surface_clip_to_visible_rect(struct window_surface *window_surface, const R
{
struct macdrv_window_surface *surface = get_mac_surface(window_surface);
+ if (!surface) return;
window_surface->funcs->lock(window_surface);
if (surface->drawn)
More information about the wine-cvs
mailing list