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 <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2016-06-02 13:30:12 +02:00
parent 1b05521bb7
commit 4865252c08

View File

@ -605,7 +605,9 @@ static void *circular_buffer_task_tx( void *_URLContext)
} else { } else {
ret = ff_neterrno(); ret = ff_neterrno();
if (ret != AVERROR(EAGAIN) && ret != AVERROR(EINTR)) { if (ret != AVERROR(EAGAIN) && ret != AVERROR(EINTR)) {
pthread_mutex_lock(&s->mutex);
s->circular_buffer_error = ret; s->circular_buffer_error = ret;
pthread_mutex_unlock(&s->mutex);
return NULL; return NULL;
} }
} }