Commit 7f0347bb authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

quartz/vmr9: Return E_INVALIDARG if both texture and offscreen flags are passed…

quartz/vmr9: Return E_INVALIDARG if both texture and offscreen flags are passed to AllocateSurfaceHelper(). Signed-off-by: 's avatarZebediah Figura <z.figura12@gmail.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent a599d645
...@@ -2760,6 +2760,13 @@ static void test_allocate_surface_helper(void) ...@@ -2760,6 +2760,13 @@ static void test_allocate_surface_helper(void)
IDirect3DSurface9_Release(surfaces[0]); 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: out:
IVMRSurfaceAllocatorNotify9_Release(notify); IVMRSurfaceAllocatorNotify9_Release(notify);
ref = IBaseFilter_Release(filter); ref = IBaseFilter_Release(filter);
......
...@@ -2042,6 +2042,13 @@ static HRESULT WINAPI VMR9SurfaceAllocatorNotify_AllocateSurfaceHelper(IVMRSurfa ...@@ -2042,6 +2042,13 @@ static HRESULT WINAPI VMR9SurfaceAllocatorNotify_AllocateSurfaceHelper(IVMRSurfa
allocinfo->dwFlags, allocinfo->dwWidth, allocinfo->dwHeight, allocinfo->dwFlags, allocinfo->dwWidth, allocinfo->dwHeight,
allocinfo->Format, allocinfo->Format, allocinfo->Pool, allocinfo->MinBuffers); 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) if (!allocinfo->Format)
{ {
IDirect3DSurface9 *backbuffer; IDirect3DSurface9 *backbuffer;
......
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