From 4865252c0817d541a98aa9c9df05161887cbdeca Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Thu, 2 Jun 2016 13:30:12 +0200 Subject: [PATCH] avformat/udp: Protect write to circular_buffer_error by mutex This isnt really needed on most platforms but fixes CID1362183 Signed-off-by: Michael Niedermayer --- libavformat/udp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/udp.c b/libavformat/udp.c index 9499a72e27..0f35689271 100644 --- a/libavformat/udp.c +++ b/libavformat/udp.c @@ -605,7 +605,9 @@ static void *circular_buffer_task_tx( void *_URLContext) } else { ret = ff_neterrno(); if (ret != AVERROR(EAGAIN) && ret != AVERROR(EINTR)) { + pthread_mutex_lock(&s->mutex); s->circular_buffer_error = ret; + pthread_mutex_unlock(&s->mutex); return NULL; } }