Commit ba0a5336 authored by James Abbatiello's avatar James Abbatiello Committed by Alexandre Julliard

Don't crash when calling DirectDrawSurface::EnumAttachedSurfaces on a

surface with no attached surfaces.
parent dbdd94ba
......@@ -867,10 +867,12 @@ HRESULT WINAPI IDirectDrawSurface4Impl_EnumAttachedSurfaces(
struct _surface_chain *chain = This->s.chain;
TRACE("(%p)->(%p,%p)\n",This,context,esfcb);
for (i=0;i<chain->nrofsurfaces;i++) {
TRACE( "Enumerating attached surface (%p)\n", chain->surfaces[i]);
if (esfcb((LPDIRECTDRAWSURFACE) chain->surfaces[i], &(chain->surfaces[i]->s.surface_desc), context) == DDENUMRET_CANCEL)
return DD_OK; /* FIXME: return value correct? */
if (chain) {
for (i=0;i<chain->nrofsurfaces;i++) {
TRACE( "Enumerating attached surface (%p)\n", chain->surfaces[i]);
if (esfcb((LPDIRECTDRAWSURFACE) chain->surfaces[i], &(chain->surfaces[i]->s.surface_desc), context) == DDENUMRET_CANCEL)
return DD_OK; /* FIXME: return value correct? */
}
}
return DD_OK;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment