Commit 9e18b7ef authored by Raphael Junqueira's avatar Raphael Junqueira Committed by Alexandre Julliard

Don't crash if pDDSD is NULL on DirectDrawSurface::Lock.

parent 12a74998
......@@ -640,14 +640,17 @@ void DDRAW_dump_surface_desc(const DDSURFACEDESC2 *lpddsd)
};
#undef STRUCT
if (lpddsd->dwSize >= sizeof(DDSURFACEDESC2)) {
DDRAW_dump_members(lpddsd->dwFlags, lpddsd, members_caps2, 1);
if (NULL == lpddsd) {
DPRINTF("(null)\n");
} else {
DDRAW_dump_members(lpddsd->dwFlags, lpddsd, members_caps, 1);
if (lpddsd->dwSize >= sizeof(DDSURFACEDESC2)) {
DDRAW_dump_members(lpddsd->dwFlags, lpddsd, members_caps2, 1);
} else {
DDRAW_dump_members(lpddsd->dwFlags, lpddsd, members_caps, 1);
}
DDRAW_dump_members(lpddsd->dwFlags, lpddsd, members,
sizeof(members)/sizeof(members[0]));
}
DDRAW_dump_members(lpddsd->dwFlags, lpddsd, members,
sizeof(members)/sizeof(members[0]));
}
void DDRAW_dump_cooperativelevel(DWORD cooplevel)
......
......@@ -1093,6 +1093,12 @@ Main_DirectDrawSurface_Lock(LPDIRECTDRAWSURFACE7 iface, LPRECT prect,
WARN(" - unsupported locking flag : "); DDRAW_dump_lockflag(flags & ~(DDLOCK_WAIT|DDLOCK_READONLY|DDLOCK_WRITEONLY));
}
}
if (NULL != h) {
return DDERR_INVALIDPARAMS;
}
if (NULL == pDDSD) {
return DDERR_INVALIDPARAMS; /** really ? */
}
/* If the surface is already locked, return busy */
if (This->locked) {
......
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