Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
93de829b
Commit
93de829b
authored
Oct 05, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 05, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
evr/presenter: Validate mixer's device id.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1d7469d9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
12 deletions
+43
-12
presenter.c
dlls/evr/presenter.c
+43
-12
No files found.
dlls/evr/presenter.c
View file @
93de829b
...
...
@@ -357,6 +357,41 @@ static ULONG WINAPI video_presenter_service_client_Release(IMFTopologyServiceLoo
return
IMFVideoPresenter_Release
(
&
presenter
->
IMFVideoPresenter_iface
);
}
static
HRESULT
video_presenter_attach_mixer
(
struct
video_presenter
*
presenter
,
IMFTopologyServiceLookup
*
service_lookup
)
{
IMFVideoDeviceID
*
device_id
;
unsigned
int
count
;
GUID
id
=
{
0
};
HRESULT
hr
;
count
=
1
;
if
(
FAILED
(
hr
=
IMFTopologyServiceLookup_LookupService
(
service_lookup
,
MF_SERVICE_LOOKUP_GLOBAL
,
0
,
&
MR_VIDEO_MIXER_SERVICE
,
&
IID_IMFTransform
,
(
void
**
)
&
presenter
->
mixer
,
&
count
)))
{
WARN
(
"Failed to get mixer interface, hr %#x.
\n
"
,
hr
);
return
hr
;
}
if
(
SUCCEEDED
(
hr
=
IMFTransform_QueryInterface
(
presenter
->
mixer
,
&
IID_IMFVideoDeviceID
,
(
void
**
)
&
device_id
)))
{
if
(
SUCCEEDED
(
hr
=
IMFVideoDeviceID_GetDeviceID
(
device_id
,
&
id
)))
{
if
(
!
IsEqualGUID
(
&
id
,
&
IID_IDirect3DDevice9
))
hr
=
MF_E_INVALIDREQUEST
;
}
IMFVideoDeviceID_Release
(
device_id
);
}
if
(
FAILED
(
hr
))
{
IMFTransform_Release
(
presenter
->
mixer
);
presenter
->
mixer
=
NULL
;
}
return
hr
;
}
static
HRESULT
WINAPI
video_presenter_service_client_InitServicePointers
(
IMFTopologyServiceLookupClient
*
iface
,
IMFTopologyServiceLookup
*
service_lookup
)
{
...
...
@@ -384,20 +419,16 @@ static HRESULT WINAPI video_presenter_service_client_InitServicePointers(IMFTopo
IMFTopologyServiceLookup_LookupService
(
service_lookup
,
MF_SERVICE_LOOKUP_GLOBAL
,
0
,
&
MR_VIDEO_RENDER_SERVICE
,
&
IID_IMFClock
,
(
void
**
)
&
presenter
->
clock
,
&
count
);
count
=
1
;
if
(
SUCCEEDED
(
hr
=
IMFTopologyServiceLookup_LookupService
(
service_lookup
,
MF_SERVICE_LOOKUP_GLOBAL
,
0
,
&
MR_VIDEO_MIXER_SERVICE
,
&
IID_IMFTransform
,
(
void
**
)
&
presenter
->
mixer
,
&
count
)))
{
/* FIXME: presumably should validate mixer's device id. */
}
else
WARN
(
"Failed to get mixer interface, hr %#x.
\n
"
,
hr
);
hr
=
video_presenter_attach_mixer
(
presenter
,
service_lookup
);
count
=
1
;
if
(
FAILED
(
hr
=
IMFTopologyServiceLookup_LookupService
(
service_lookup
,
MF_SERVICE_LOOKUP_GLOBAL
,
0
,
&
MR_VIDEO_RENDER_SERVICE
,
&
IID_IMediaEventSink
,
(
void
**
)
&
presenter
->
event_sink
,
&
count
)))
if
(
SUCCEEDED
(
hr
))
{
WARN
(
"Failed to get renderer event sink, hr %#x.
\n
"
,
hr
);
count
=
1
;
if
(
FAILED
(
hr
=
IMFTopologyServiceLookup_LookupService
(
service_lookup
,
MF_SERVICE_LOOKUP_GLOBAL
,
0
,
&
MR_VIDEO_RENDER_SERVICE
,
&
IID_IMediaEventSink
,
(
void
**
)
&
presenter
->
event_sink
,
&
count
)))
{
WARN
(
"Failed to get renderer event sink, hr %#x.
\n
"
,
hr
);
}
}
if
(
SUCCEEDED
(
hr
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment