Commit 66948f89 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

mfplay: Handle NULL item in SetMediaItem().

parent c6c3d6f9
......@@ -1224,12 +1224,16 @@ static HRESULT media_item_create_topology(struct media_player *player, struct me
static HRESULT WINAPI media_player_SetMediaItem(IMFPMediaPlayer *iface, IMFPMediaItem *item_iface)
{
struct media_player *player = impl_from_IMFPMediaPlayer(iface);
struct media_item *item = unsafe_impl_from_IMFPMediaItem(item_iface);
struct media_item *item;
IMFTopology *topology;
HRESULT hr;
TRACE("%p, %p.\n", iface, item_iface);
if (!item_iface)
return E_POINTER;
item = unsafe_impl_from_IMFPMediaItem(item_iface);
if (item->player != iface)
return E_INVALIDARG;
......
......@@ -198,8 +198,23 @@ static void test_shutdown(void)
IMFPMediaPlayer_Release(player);
}
static void test_media_item(void)
{
IMFPMediaPlayer *player;
HRESULT hr;
hr = MFPCreateMediaPlayer(NULL, FALSE, 0, NULL, NULL, &player);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
hr = IMFPMediaPlayer_SetMediaItem(player, NULL);
ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
IMFPMediaPlayer_Release(player);
}
START_TEST(mfplay)
{
test_create_player();
test_shutdown();
test_media_item();
}
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