[vlc-devel] [PATCH] demux: adaptive: fix null-pointer dereference and race condition

Francois Cartegnie fcvlcdev at free.fr
Wed Aug 8 13:49:55 CEST 2018


Le 07/08/2018 à 05:12, Zhao Zhili a écrit :
> ---
>  modules/demux/adaptive/http/Chunk.cpp | 9 ++++++++-
>  modules/demux/adaptive/http/Chunk.h   | 3 +++
>  2 files changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/modules/demux/adaptive/http/Chunk.cpp b/modules/demux/adaptive/http/Chunk.cpp
> index a4269e3..d8bc0f3 100644
> --- a/modules/demux/adaptive/http/Chunk.cpp
> +++ b/modules/demux/adaptive/http/Chunk.cpp
> @@ -136,6 +136,7 @@ HTTPChunkSource::HTTPChunkSource(const std::string& url, AbstractConnectionManag
>      prepared = false;
>      eof = false;
>      sourceid = id;
> +    vlc_mutex_init(&contentTypeLock);
>      setUseAccess(access);

I don't think another kind of lock is required.
The buffered chunk was already locking, we just need to move lock to the
base class then.

see cedb5bb7fbda46f1bc7cc6ac834905ed4c140dfc

-- 
Francois Cartegnie
VideoLAN - VLC Developer


More information about the vlc-devel mailing list