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
8337ffb7
Commit
8337ffb7
authored
Jun 05, 2011
by
Jörg Höhle
Committed by
Alexandre Julliard
Jun 06, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winecoreaudio: Properly allocate the WAVEFORMATEXTENSIBLE returned by GetMixFormat.
parent
d726cf88
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
mmdevdrv.c
dlls/winecoreaudio.drv/mmdevdrv.c
+8
-8
No files found.
dlls/winecoreaudio.drv/mmdevdrv.c
View file @
8337ffb7
...
...
@@ -1155,13 +1155,12 @@ static HRESULT WINAPI AudioClient_GetMixFormat(IAudioClient *iface,
if
(
!
pwfx
)
return
E_POINTER
;
*
pwfx
=
NULL
;
*
pwfx
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
WAVEFORMATEXTENSIBLE
));
if
(
!
*
pwfx
)
fmt
=
CoTaskMemAlloc
(
sizeof
(
WAVEFORMATEXTENSIBLE
));
if
(
!
fmt
)
return
E_OUTOFMEMORY
;
fmt
=
(
WAVEFORMATEXTENSIBLE
*
)
*
pwfx
;
fmt
->
Format
.
wFormatTag
=
WAVE_FORMAT_EXTENSIBLE
;
addr
.
mScope
=
This
->
scope
;
...
...
@@ -1170,21 +1169,21 @@ static HRESULT WINAPI AudioClient_GetMixFormat(IAudioClient *iface,
sc
=
AudioObjectGetPropertyDataSize
(
This
->
adevid
,
&
addr
,
0
,
NULL
,
&
size
);
if
(
sc
!=
noErr
){
HeapFree
(
GetProcessHeap
(),
0
,
fmt
);
CoTaskMemFree
(
fmt
);
WARN
(
"Unable to get size for _StreamConfiguration property: %lx
\n
"
,
sc
);
return
E_FAIL
;
}
buffers
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
if
(
!
buffers
){
HeapFree
(
GetProcessHeap
(),
0
,
fmt
);
CoTaskMemFree
(
fmt
);
return
E_OUTOFMEMORY
;
}
sc
=
AudioObjectGetPropertyData
(
This
->
adevid
,
&
addr
,
0
,
NULL
,
&
size
,
buffers
);
if
(
sc
!=
noErr
){
HeapFree
(
GetProcessHeap
(),
0
,
fmt
);
CoTaskMemFree
(
fmt
);
HeapFree
(
GetProcessHeap
(),
0
,
buffers
);
WARN
(
"Unable to get _StreamConfiguration property: %lx
\n
"
,
sc
);
return
E_FAIL
;
...
...
@@ -1202,7 +1201,7 @@ static HRESULT WINAPI AudioClient_GetMixFormat(IAudioClient *iface,
size
=
sizeof
(
Float64
);
sc
=
AudioObjectGetPropertyData
(
This
->
adevid
,
&
addr
,
0
,
NULL
,
&
size
,
&
rate
);
if
(
sc
!=
noErr
){
HeapFree
(
GetProcessHeap
(),
0
,
fmt
);
CoTaskMemFree
(
fmt
);
WARN
(
"Unable to get _NominalSampleRate property: %lx
\n
"
,
sc
);
return
E_FAIL
;
}
...
...
@@ -1221,6 +1220,7 @@ static HRESULT WINAPI AudioClient_GetMixFormat(IAudioClient *iface,
fmt
->
Samples
.
wValidBitsPerSample
=
fmt
->
Format
.
wBitsPerSample
;
fmt
->
Format
.
cbSize
=
sizeof
(
WAVEFORMATEXTENSIBLE
)
-
sizeof
(
WAVEFORMATEX
);
*
pwfx
=
(
WAVEFORMATEX
*
)
fmt
;
dump_fmt
(
*
pwfx
);
return
S_OK
;
...
...
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