[vlc-devel] [PATCHv2 3/3] mmdevice: sys->dev need to be read locked
Rémi Denis-Courmont
remi at remlab.net
Thu Jul 6 12:25:37 CEST 2017
Le 6 juillet 2017 12:25:01 GMT+03:00, Thomas Guillem <thomas at gllm.fr> a écrit :
>---
> modules/audio_output/mmdevice.c | 12 +++++++++---
> 1 file changed, 9 insertions(+), 3 deletions(-)
>
>diff --git a/modules/audio_output/mmdevice.c
>b/modules/audio_output/mmdevice.c
>index 194a8bf91b..772fb48565 100644
>--- a/modules/audio_output/mmdevice.c
>+++ b/modules/audio_output/mmdevice.c
>@@ -1087,9 +1087,6 @@ static int Start(audio_output_t *aout,
>audio_sample_format_t *restrict fmt)
> {
> aout_sys_t *sys = aout->sys;
>
>- if (sys->dev == NULL)
>- return -1;
>-
> aout_stream_t *s = vlc_object_create(aout, sizeof (*s));
> if (unlikely(s == NULL))
> return -1;
>@@ -1098,6 +1095,15 @@ static int Start(audio_output_t *aout,
>audio_sample_format_t *restrict fmt)
>
> EnterMTA();
> EnterCriticalSection(&sys->lock);
>+
>+ if (sys->dev == NULL)
>+ {
>+ vlc_object_release(s);
>+ LeaveCriticalSection(&sys->lock);
>+ LeaveMTA();
>+ return -1;
>+ }
>+
> for (;;)
> {
> HRESULT hr;
>--
>2.11.0
>
>_______________________________________________
>vlc-devel mailing list
>To unsubscribe or modify your subscription options:
>https://mailman.videolan.org/listinfo/vlc-devel
No, I don't think so. I can't see how sys->dev can change there. And if it did, this patch would not be sufficient AFAICT.
--
Rémi Denis-Courmont
Typed on an inconvenient virtual keyboard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20170706/e46d06b2/attachment.html>
More information about the vlc-devel
mailing list