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
c5663827
Commit
c5663827
authored
Feb 23, 2023
by
Tingzhong Luo
Committed by
Alexandre Julliard
Feb 24, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
evr: Fix crash when clearing input type for the mixer.
Signed-off-by:
Tingzhong Luo
<
luotingzhong@uniontech.com
>
parent
aa3e772a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
2 deletions
+51
-2
mixer.c
dlls/evr/mixer.c
+7
-2
evr.c
dlls/evr/tests/evr.c
+44
-0
No files found.
dlls/evr/mixer.c
View file @
c5663827
...
...
@@ -240,7 +240,7 @@ static void video_mixer_clear_types(struct video_mixer *mixer)
free
(
mixer
->
output
.
rt_formats
);
if
(
mixer
->
output
.
media_type
)
IMFMediaType_Release
(
mixer
->
output
.
media_type
);
m
ixer
->
output
.
media_type
=
NULL
;
m
emset
(
&
mixer
->
output
,
0
,
sizeof
(
mixer
->
output
))
;
}
static
HRESULT
WINAPI
video_mixer_inner_QueryInterface
(
IUnknown
*
iface
,
REFIID
riid
,
void
**
obj
)
...
...
@@ -855,12 +855,17 @@ static HRESULT WINAPI video_mixer_transform_SetInputType(IMFTransform *iface, DW
TRACE
(
"%p, %lu, %p, %#lx.
\n
"
,
iface
,
id
,
media_type
,
flags
);
if
(
!
media_type
&&
(
flags
&
MFT_SET_TYPE_TEST_ONLY
))
return
E_INVALIDARG
;
EnterCriticalSection
(
&
mixer
->
cs
);
if
(
!
(
flags
&
MFT_SET_TYPE_TEST_ONLY
))
video_mixer_clear_types
(
mixer
);
if
(
!
mixer
->
device_manager
)
if
(
!
media_type
)
hr
=
S_OK
;
else
if
(
!
mixer
->
device_manager
)
hr
=
MF_E_NOT_INITIALIZED
;
else
{
...
...
dlls/evr/tests/evr.c
View file @
c5663827
...
...
@@ -1249,6 +1249,11 @@ static void test_default_mixer_type_negotiation(void)
goto
done
;
}
hr
=
IMFTransform_SetInputType
(
transform
,
0
,
NULL
,
0
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFTransform_SetInputType
(
transform
,
0
,
NULL
,
MFT_SET_TYPE_TEST_ONLY
);
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
DXVA2CreateDirect3DDeviceManager9
(
&
token
,
&
manager
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
...
...
@@ -1469,9 +1474,48 @@ static void test_default_mixer_type_negotiation(void)
hr
=
IMFTransform_GetOutputCurrentType
(
transform
,
0
,
&
media_type2
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
media_type
==
media_type2
,
"Unexpected media type instance.
\n
"
);
IMFMediaType_Release
(
media_type
);
/* Clear input types */
hr
=
IMFTransform_SetInputType
(
transform
,
0
,
NULL
,
MFT_SET_TYPE_TEST_ONLY
);
ok
(
hr
==
E_INVALIDARG
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFTransform_SetInputType
(
transform
,
0
,
NULL
,
0
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFTransform_GetInputCurrentType
(
transform
,
0
,
&
media_type
);
ok
(
hr
==
MF_E_TRANSFORM_TYPE_NOT_SET
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFTransform_GetOutputCurrentType
(
transform
,
0
,
&
media_type
);
ok
(
hr
==
MF_E_TRANSFORM_TYPE_NOT_SET
,
"Unexpected hr %#lx.
\n
"
,
hr
);
/* Restore types */
hr
=
IMFTransform_SetOutputType
(
transform
,
0
,
media_type2
,
0
);
ok
(
hr
==
MF_E_INVALIDMEDIATYPE
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFTransform_GetOutputCurrentType
(
transform
,
0
,
&
media_type
);
ok
(
hr
==
MF_E_TRANSFORM_TYPE_NOT_SET
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFTransform_SetInputType
(
transform
,
0
,
video_type
,
0
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFTransform_GetInputCurrentType
(
transform
,
0
,
&
media_type
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
media_type
==
video_type
,
"Unexpected media type instance.
\n
"
);
IMFMediaType_Release
(
media_type
);
hr
=
IMFTransform_SetOutputType
(
transform
,
0
,
media_type2
,
0
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFTransform_GetOutputCurrentType
(
transform
,
0
,
&
media_type
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
media_type2
==
media_type
,
"Unexpected media type instance.
\n
"
);
IMFMediaType_Release
(
media_type2
);
IMFMediaType_Release
(
media_type
);
/* Resetting type twice */
hr
=
IMFTransform_SetInputType
(
transform
,
0
,
NULL
,
0
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
hr
=
IMFTransform_SetInputType
(
transform
,
0
,
NULL
,
0
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
IMFVideoProcessor_Release
(
processor
);
IMFMediaType_Release
(
video_type
);
...
...
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