Commit 4f651808 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Disallow empty surfaces.

parent 2fb7edc3
......@@ -10613,11 +10613,8 @@ static void depth_bounds_test(IDirect3DDevice9 *device)
hr = IDirect3DDevice9_CreateOffscreenPlainSurface(device, 32, 32,
MAKEFOURCC('N','V','D','B'), D3DPOOL_DEFAULT, &offscreen_surface, NULL);
todo_wine ok(hr != D3D_OK, "Able to create surface, hr = %08x\n", hr);
if(offscreen_surface)
{
IDirect3DSurface9_Release(offscreen_surface);
}
ok(FAILED(hr), "Able to create surface, hr %#x.\n", hr);
if (offscreen_surface) IDirect3DSurface9_Release(offscreen_surface);
hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xffffffff, 1.0, 0);
ok(SUCCEEDED(hr), "Clear failed, hr %#x.\n", hr);
......
......@@ -353,6 +353,7 @@ HRESULT surface_init(IWineD3DSurfaceImpl *surface, WINED3DSURFTYPE surface_type,
/* FIXME: Check that the format is supported by the device. */
resource_size = wined3d_format_calculate_size(format, alignment, width, height);
if (!resource_size) return WINED3DERR_INVALIDCALL;
/* Look at the implementation and set the correct Vtable. */
switch (surface_type)
......
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