Commit a4ddb5a1 authored by Gijs Vermeulen's avatar Gijs Vermeulen Committed by Alexandre Julliard

amstream: Return E_INVALIDARG when a rect but no surface is passed in…

amstream: Return E_INVALIDARG when a rect but no surface is passed in IDirectDrawMediaStream::CreateSample(). Signed-off-by: 's avatarGijs Vermeulen <gijsvrm@gmail.com> Signed-off-by: 's avatarZebediah Figura <z.figura12@gmail.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 7bdb713b
...@@ -442,6 +442,9 @@ static HRESULT WINAPI ddraw_IDirectDrawMediaStream_CreateSample(IDirectDrawMedia ...@@ -442,6 +442,9 @@ static HRESULT WINAPI ddraw_IDirectDrawMediaStream_CreateSample(IDirectDrawMedia
TRACE("stream %p, surface %p, rect %s, flags %#x, sample %p.\n", TRACE("stream %p, surface %p, rect %s, flags %#x, sample %p.\n",
stream, surface, wine_dbgstr_rect(rect), flags, sample); stream, surface, wine_dbgstr_rect(rect), flags, sample);
if (!surface && rect)
return E_INVALIDARG;
EnterCriticalSection(&stream->cs); EnterCriticalSection(&stream->cs);
hr = ddrawstreamsample_create(stream, surface, rect, sample); hr = ddrawstreamsample_create(stream, surface, rect, sample);
LeaveCriticalSection(&stream->cs); LeaveCriticalSection(&stream->cs);
......
...@@ -5665,7 +5665,7 @@ static void test_ddrawstream_create_sample(void) ...@@ -5665,7 +5665,7 @@ static void test_ddrawstream_create_sample(void)
SetRectEmpty(&rect); SetRectEmpty(&rect);
hr = IDirectDrawMediaStream_CreateSample(ddraw_stream, NULL, &rect, 0, &sample); hr = IDirectDrawMediaStream_CreateSample(ddraw_stream, NULL, &rect, 0, &sample);
todo_wine ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr); ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr);
EXPECT_REF(stream, 3); EXPECT_REF(stream, 3);
hr = IDirectDrawMediaStream_CreateSample(ddraw_stream, NULL, NULL, 0, &sample); hr = IDirectDrawMediaStream_CreateSample(ddraw_stream, NULL, NULL, 0, &sample);
......
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