Signed-off-by: Gijs Vermeulen gijsvrm@gmail.com --- dlls/amstream/ddrawstream.c | 3 +++ dlls/amstream/tests/amstream.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/dlls/amstream/ddrawstream.c b/dlls/amstream/ddrawstream.c index 4c94bacf52..917fcad9c9 100644 --- a/dlls/amstream/ddrawstream.c +++ b/dlls/amstream/ddrawstream.c @@ -442,6 +442,9 @@ static HRESULT WINAPI ddraw_IDirectDrawMediaStream_CreateSample(IDirectDrawMedia TRACE("stream %p, surface %p, rect %s, flags %#x, sample %p.\n", stream, surface, wine_dbgstr_rect(rect), flags, sample);
+ if (!surface && rect) + return E_INVALIDARG; + EnterCriticalSection(&stream->cs); hr = ddrawstreamsample_create(stream, surface, rect, sample); LeaveCriticalSection(&stream->cs); diff --git a/dlls/amstream/tests/amstream.c b/dlls/amstream/tests/amstream.c index 17ff110f11..4149ff0cd6 100644 --- a/dlls/amstream/tests/amstream.c +++ b/dlls/amstream/tests/amstream.c @@ -5664,7 +5664,7 @@ static void test_ddrawstream_create_sample(void)
SetRectEmpty(&rect); 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); hr = IDirectDrawMediaStream_CreateSample(ddraw_stream, NULL, NULL, 0, &sample);