From 1edda50c03cfce6f6f1e79fbbab88e41c1441b21 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Mon, 19 Jul 2010 12:47:59 +0200 Subject: [PATCH] ddraw: The surface isn't allowed to be NULL in EnumSurfacesCallbackThunk() and EnumCallback(). --- dlls/ddraw/ddraw_thunks.c | 5 ++--- dlls/ddraw/surface_thunks.c | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/dlls/ddraw/ddraw_thunks.c b/dlls/ddraw/ddraw_thunks.c index 28991d1aeed..2c205e90573 100644 --- a/dlls/ddraw/ddraw_thunks.c +++ b/dlls/ddraw/ddraw_thunks.c @@ -578,9 +578,8 @@ EnumSurfacesCallbackThunk(LPDIRECTDRAWSURFACE7 pSurf, LPDDSURFACEDESC2 pDDSD, /* This coercion is safe, since the IDirectDrawSurface3 vtable has the * IDirectDrawSurface vtable layout at the beginning */ - return cbcontext->func( - pSurf ? (IDirectDrawSurface *)&((IDirectDrawSurfaceImpl *)pSurf)->IDirectDrawSurface3_vtbl : NULL, - (LPDDSURFACEDESC)pDDSD, cbcontext->context); + return cbcontext->func((IDirectDrawSurface *)&((IDirectDrawSurfaceImpl *)pSurf)->IDirectDrawSurface3_vtbl, + (DDSURFACEDESC *)pDDSD, cbcontext->context); } static HRESULT WINAPI diff --git a/dlls/ddraw/surface_thunks.c b/dlls/ddraw/surface_thunks.c index be57c3b1f29..6df6dcdfae9 100644 --- a/dlls/ddraw/surface_thunks.c +++ b/dlls/ddraw/surface_thunks.c @@ -150,9 +150,8 @@ EnumCallback(LPDIRECTDRAWSURFACE7 iface, LPDDSURFACEDESC2 pDDSD, { const struct callback_info* info = context; - return info->callback(iface ? - (IDirectDrawSurface *)&((IDirectDrawSurfaceImpl *)iface)->IDirectDrawSurface3_vtbl : NULL, - (LPDDSURFACEDESC)pDDSD, info->context); + return info->callback((IDirectDrawSurface *)&((IDirectDrawSurfaceImpl *)iface)->IDirectDrawSurface3_vtbl, + (DDSURFACEDESC *)pDDSD, info->context); } static HRESULT WINAPI