quartz/vmr9: Return E_INVALIDARG if both texture and offscreen flags are passed to AllocateSurfaceHelper().

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2020-07-21 17:49:57 -05:00 committed by Alexandre Julliard
parent a599d645e3
commit 7f0347bb04
2 changed files with 14 additions and 0 deletions

View File

@ -2760,6 +2760,13 @@ static void test_allocate_surface_helper(void)
IDirect3DSurface9_Release(surfaces[0]);
info.Format = D3DFMT_A8R8G8B8;
info.dwFlags = VMR9AllocFlag_OffscreenSurface | VMR9AllocFlag_TextureSurface;
count = 1;
hr = IVMRSurfaceAllocatorNotify9_AllocateSurfaceHelper(notify, &info, &count, surfaces);
ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr);
ok(count == 1, "Got count %u.\n", count);
out:
IVMRSurfaceAllocatorNotify9_Release(notify);
ref = IBaseFilter_Release(filter);

View File

@ -2042,6 +2042,13 @@ static HRESULT WINAPI VMR9SurfaceAllocatorNotify_AllocateSurfaceHelper(IVMRSurfa
allocinfo->dwFlags, allocinfo->dwWidth, allocinfo->dwHeight,
allocinfo->Format, allocinfo->Format, allocinfo->Pool, allocinfo->MinBuffers);
if ((allocinfo->dwFlags & VMR9AllocFlag_TextureSurface)
&& (allocinfo->dwFlags & VMR9AllocFlag_OffscreenSurface))
{
WARN("Invalid flags specified; returning E_INVALIDARG.\n");
return E_INVALIDARG;
}
if (!allocinfo->Format)
{
IDirect3DSurface9 *backbuffer;