ddraw: The surface isn't allowed to be NULL in EnumSurfacesCallbackThunk() and EnumCallback().

This commit is contained in:
Henri Verbeet 2010-07-19 12:47:59 +02:00 committed by Alexandre Julliard
parent 5bf9dd902c
commit 1edda50c03
2 changed files with 4 additions and 6 deletions

View File

@ -578,9 +578,8 @@ EnumSurfacesCallbackThunk(LPDIRECTDRAWSURFACE7 pSurf, LPDDSURFACEDESC2 pDDSD,
/* This coercion is safe, since the IDirectDrawSurface3 vtable has the /* This coercion is safe, since the IDirectDrawSurface3 vtable has the
* IDirectDrawSurface vtable layout at the beginning */ * IDirectDrawSurface vtable layout at the beginning */
return cbcontext->func( return cbcontext->func((IDirectDrawSurface *)&((IDirectDrawSurfaceImpl *)pSurf)->IDirectDrawSurface3_vtbl,
pSurf ? (IDirectDrawSurface *)&((IDirectDrawSurfaceImpl *)pSurf)->IDirectDrawSurface3_vtbl : NULL, (DDSURFACEDESC *)pDDSD, cbcontext->context);
(LPDDSURFACEDESC)pDDSD, cbcontext->context);
} }
static HRESULT WINAPI static HRESULT WINAPI

View File

@ -150,9 +150,8 @@ EnumCallback(LPDIRECTDRAWSURFACE7 iface, LPDDSURFACEDESC2 pDDSD,
{ {
const struct callback_info* info = context; const struct callback_info* info = context;
return info->callback(iface ? return info->callback((IDirectDrawSurface *)&((IDirectDrawSurfaceImpl *)iface)->IDirectDrawSurface3_vtbl,
(IDirectDrawSurface *)&((IDirectDrawSurfaceImpl *)iface)->IDirectDrawSurface3_vtbl : NULL, (DDSURFACEDESC *)pDDSD, info->context);
(LPDDSURFACEDESC)pDDSD, info->context);
} }
static HRESULT WINAPI static HRESULT WINAPI