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
2c82e8b4
Commit
2c82e8b4
authored
Feb 10, 2016
by
Andrew Eikum
Committed by
Alexandre Julliard
Feb 11, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xaudio2: Protect access to source voice during creation (Coverity).
Signed-off-by:
Andrew Eikum
<
aeikum@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f461610e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
xaudio_dll.c
dlls/xaudio2_7/xaudio_dll.c
+9
-0
No files found.
dlls/xaudio2_7/xaudio_dll.c
View file @
2c82e8b4
...
...
@@ -1367,8 +1367,10 @@ static HRESULT WINAPI IXAudio2Impl_CreateSourceVoice(IXAudio2 *iface,
EnterCriticalSection
(
&
This
->
lock
);
LIST_FOR_EACH_ENTRY
(
src
,
&
This
->
source_voices
,
XA2SourceImpl
,
entry
){
EnterCriticalSection
(
&
src
->
lock
);
if
(
!
src
->
in_use
)
break
;
LeaveCriticalSection
(
&
src
->
lock
);
}
if
(
&
src
->
entry
==
&
This
->
source_voices
){
...
...
@@ -1394,6 +1396,8 @@ static HRESULT WINAPI IXAudio2Impl_CreateSourceVoice(IXAudio2 *iface,
src
->
lock
.
DebugInfo
->
Spare
[
0
]
=
(
DWORD_PTR
)(
__FILE__
": XA2SourceImpl.lock"
);
src
->
xa2
=
This
;
EnterCriticalSection
(
&
src
->
lock
);
}
src
->
in_use
=
TRUE
;
...
...
@@ -1406,6 +1410,7 @@ static HRESULT WINAPI IXAudio2Impl_CreateSourceVoice(IXAudio2 *iface,
src
->
al_fmt
=
get_al_format
(
pSourceFormat
);
if
(
!
src
->
al_fmt
){
src
->
in_use
=
FALSE
;
LeaveCriticalSection
(
&
src
->
lock
);
WARN
(
"OpenAL can't convert this format!
\n
"
);
return
AUDCLNT_E_UNSUPPORTED_FORMAT
;
}
...
...
@@ -1418,6 +1423,7 @@ static HRESULT WINAPI IXAudio2Impl_CreateSourceVoice(IXAudio2 *iface,
if
(
FAILED
(
hr
)){
HeapFree
(
GetProcessHeap
(),
0
,
src
->
fmt
);
src
->
in_use
=
FALSE
;
LeaveCriticalSection
(
&
src
->
lock
);
return
hr
;
}
...
...
@@ -1428,6 +1434,7 @@ static HRESULT WINAPI IXAudio2Impl_CreateSourceVoice(IXAudio2 *iface,
ERR_
(
winediag
)(
"OpenAL ran out of sources, consider increasing its source limit.
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
src
->
fmt
);
src
->
in_use
=
FALSE
;
LeaveCriticalSection
(
&
src
->
lock
);
return
E_OUTOFMEMORY
;
}
...
...
@@ -1435,6 +1442,8 @@ static HRESULT WINAPI IXAudio2Impl_CreateSourceVoice(IXAudio2 *iface,
alSourcePlay
(
src
->
al_src
);
LeaveCriticalSection
(
&
src
->
lock
);
#if XAUDIO2_VER == 0
*
ppSourceVoice
=
(
IXAudio2SourceVoice
*
)
&
src
->
IXAudio20SourceVoice_iface
;
#elif XAUDIO2_VER <= 3
...
...
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