Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
690fbf64
Commit
690fbf64
authored
Feb 24, 2020
by
Zebediah Figura
Committed by
Alexandre Julliard
Feb 25, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mp3dmod: Verify the format type in IMediaObject::SetOutputType().
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
6d55954b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
0 deletions
+29
-0
mp3dmod.c
dlls/mp3dmod/mp3dmod.c
+3
-0
mp3dmod.c
dlls/mp3dmod/tests/mp3dmod.c
+26
-0
No files found.
dlls/mp3dmod/mp3dmod.c
View file @
690fbf64
...
...
@@ -266,6 +266,9 @@ static HRESULT WINAPI MediaObject_SetOutputType(IMediaObject *iface, DWORD index
return
S_OK
;
}
if
(
!
IsEqualGUID
(
&
type
->
formattype
,
&
WMFORMAT_WaveFormatEx
))
return
DMO_E_TYPE_NOT_ACCEPTED
;
format
=
(
WAVEFORMATEX
*
)
type
->
pbFormat
;
if
(
format
->
wBitsPerSample
==
8
)
...
...
dlls/mp3dmod/tests/mp3dmod.c
View file @
690fbf64
...
...
@@ -394,6 +394,21 @@ static void test_media_types(void)
.
nSamplesPerSec
=
48000
,
};
WAVEFORMATEX
output_format
=
{
.
nChannels
=
1
,
.
nSamplesPerSec
=
48000
,
.
nAvgBytesPerSec
=
48000
,
.
nBlockAlign
=
1
,
.
wBitsPerSample
=
8
,
};
DMO_MEDIA_TYPE
output_mt
=
{
.
formattype
=
FORMAT_WaveFormatEx
,
.
cbFormat
=
sizeof
(
output_format
),
.
pbFormat
=
(
BYTE
*
)
&
output_format
,
};
DMO_MEDIA_TYPE
mt
;
IMediaObject
*
dmo
;
HRESULT
hr
;
...
...
@@ -514,6 +529,17 @@ static void test_media_types(void)
hr
=
IMediaObject_GetOutputType
(
dmo
,
0
,
2
,
&
mt
);
ok
(
hr
==
DMO_E_NO_MORE_ITEMS
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
IMediaObject_SetOutputType
(
dmo
,
0
,
&
output_mt
,
DMO_SET_TYPEF_TEST_ONLY
);
ok
(
hr
==
S_OK
,
"Got hr %#x.
\n
"
,
hr
);
output_mt
.
formattype
=
GUID_NULL
;
hr
=
IMediaObject_SetOutputType
(
dmo
,
0
,
&
output_mt
,
DMO_SET_TYPEF_TEST_ONLY
);
ok
(
hr
==
DMO_E_TYPE_NOT_ACCEPTED
,
"Got hr %#x.
\n
"
,
hr
);
output_mt
.
formattype
=
FORMAT_None
;
hr
=
IMediaObject_SetOutputType
(
dmo
,
0
,
&
output_mt
,
DMO_SET_TYPEF_TEST_ONLY
);
ok
(
hr
==
DMO_E_TYPE_NOT_ACCEPTED
,
"Got hr %#x.
\n
"
,
hr
);
output_mt
.
formattype
=
FORMAT_WaveFormatEx
;
IMediaObject_Release
(
dmo
);
}
...
...
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