Commit 8c9418fb authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

dxva2: Limit allowed number of substreams in CreateVideoProcessor().

parent ef584679
...@@ -496,6 +496,12 @@ static HRESULT WINAPI device_manager_processor_service_CreateVideoProcessor(IDir ...@@ -496,6 +496,12 @@ static HRESULT WINAPI device_manager_processor_service_CreateVideoProcessor(IDir
/* FIXME: validate render target format */ /* FIXME: validate render target format */
if (max_substreams >= 16)
{
WARN("Invalid substreams count %u.\n", max_substreams);
return E_INVALIDARG;
}
if (!(object = heap_alloc_zero(sizeof(*object)))) if (!(object = heap_alloc_zero(sizeof(*object))))
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
......
...@@ -470,9 +470,7 @@ static void test_video_processor(void) ...@@ -470,9 +470,7 @@ static void test_video_processor(void)
/* Number of substreams does not include reference stream. */ /* Number of substreams does not include reference stream. */
hr = IDirectXVideoProcessorService_CreateVideoProcessor(service, &DXVA2_VideoProcSoftwareDevice, &video_desc, hr = IDirectXVideoProcessorService_CreateVideoProcessor(service, &DXVA2_VideoProcSoftwareDevice, &video_desc,
D3DFMT_A8R8G8B8, 16, &processor); D3DFMT_A8R8G8B8, 16, &processor);
todo_wine
ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr); ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
if (SUCCEEDED(hr)) IDirectXVideoProcessor_Release(processor);
hr = IDirectXVideoProcessorService_CreateVideoProcessor(service, &DXVA2_VideoProcSoftwareDevice, &video_desc, hr = IDirectXVideoProcessorService_CreateVideoProcessor(service, &DXVA2_VideoProcSoftwareDevice, &video_desc,
D3DFMT_A8R8G8B8, 15, &processor); D3DFMT_A8R8G8B8, 15, &processor);
......
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