Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
9eb9a10e
Commit
9eb9a10e
authored
Feb 01, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DirectSound: fix double free on error (close #5966)
Regression from
6d90bf20
parent
f09289e8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
15 deletions
+5
-15
modules/audio_output/directx.c
modules/audio_output/directx.c
+5
-15
No files found.
modules/audio_output/directx.c
View file @
9eb9a10e
...
...
@@ -92,7 +92,6 @@ struct aout_sys_t
*****************************************************************************/
static
int
OpenAudio
(
vlc_object_t
*
);
static
void
CloseAudio
(
vlc_object_t
*
);
static
void
CloseAudioCommon
(
vlc_object_t
*
);
static
void
Play
(
audio_output_t
*
,
block_t
*
);
/* local functions */
...
...
@@ -278,8 +277,7 @@ static int OpenAudio( vlc_object_t *p_this )
!=
VLC_SUCCESS
)
{
msg_Err
(
p_aout
,
"cannot open directx audio device"
);
free
(
p_aout
->
sys
);
return
VLC_EGENERIC
;
goto
error
;
}
/* Calculate the frame size in bytes */
...
...
@@ -303,8 +301,8 @@ static int OpenAudio( vlc_object_t *p_this )
msg_Err
(
p_aout
,
"cannot create DirectSoundThread"
);
CloseHandle
(
p_aout
->
sys
->
notif
.
event
);
p_aout
->
sys
->
notif
.
event
=
NULL
;
CloseAudio
(
VLC_OBJECT
(
p_aout
)
);
return
VLC_EGENERIC
;
aout_PacketDestroy
(
p_aout
);
goto
error
;
}
p_aout
->
pf_play
=
Play
;
...
...
@@ -314,7 +312,7 @@ static int OpenAudio( vlc_object_t *p_this )
return
VLC_SUCCESS
;
error:
CloseAudio
Common
(
VLC_OBJECT
(
p_aout
)
);
CloseAudio
(
VLC_OBJECT
(
p_aout
)
);
return
VLC_EGENERIC
;
}
...
...
@@ -576,13 +574,6 @@ static void Play( audio_output_t *p_aout, block_t *p_buffer )
* CloseAudio: close the audio device
*****************************************************************************/
static
void
CloseAudio
(
vlc_object_t
*
p_this
)
{
audio_output_t
*
p_aout
=
(
audio_output_t
*
)
p_this
;
aout_PacketDestroy
(
p_aout
);
CloseAudioCommon
(
p_this
);
}
static
void
CloseAudioCommon
(
vlc_object_t
*
p_this
)
{
audio_output_t
*
p_aout
=
(
audio_output_t
*
)
p_this
;
aout_sys_t
*
p_sys
=
p_aout
->
sys
;
...
...
@@ -599,6 +590,7 @@ static void CloseAudioCommon( vlc_object_t *p_this )
vlc_join
(
p_sys
->
notif
.
thread
,
NULL
);
CloseHandle
(
p_sys
->
notif
.
event
);
aout_PacketDestroy
(
p_aout
);
}
/* release the secondary buffer */
...
...
@@ -610,8 +602,6 @@ static void CloseAudioCommon( vlc_object_t *p_this )
/* free DSOUND.DLL */
if
(
p_sys
->
hdsound_dll
)
FreeLibrary
(
p_sys
->
hdsound_dll
);
aout_PacketDestroy
(
p_aout
);
free
(
p_aout
->
sys
->
p_device_guid
);
free
(
p_sys
);
}
...
...
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