[FFmpeg-cvslog] avformat/udp: Protect write to circular_buffer_error by mutex

Michael Niedermayer git at videolan.org
Thu Jun 2 13:43:24 CEST 2016


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Thu Jun  2 13:30:12 2016 +0200| [4865252c0817d541a98aa9c9df05161887cbdeca] | committer: Michael Niedermayer

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 at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4865252c0817d541a98aa9c9df05161887cbdeca
---

 libavformat/udp.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/udp.c b/libavformat/udp.c
index 9499a72..0f35689 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;
                 }
             }



More information about the ffmpeg-cvslog mailing list