[FFmpeg-cvslog] udp: check ff_socket_nonblock() return code

Michael Niedermayer git at videolan.org
Mon Nov 5 21:35:57 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Nov  5 21:21:04 2012 +0100| [282a6308bfd20e092e470547cf60d3bd6b507314] | committer: Michael Niedermayer

udp: check ff_socket_nonblock() return code

Fixes CID733719
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavformat/udp.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavformat/udp.c b/libavformat/udp.c
index a88fbe4..184ab81 100644
--- a/libavformat/udp.c
+++ b/libavformat/udp.c
@@ -442,8 +442,12 @@ static void *circular_buffer_task( void *_URLContext)
     int old_cancelstate;
 
     pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &old_cancelstate);
-    ff_socket_nonblock(s->udp_fd, 0);
     pthread_mutex_lock(&s->mutex);
+    if (ff_socket_nonblock(s->udp_fd, 0) < 0) {
+        av_log(h, AV_LOG_ERROR, "Failed to set blocking mode");
+        s->circular_buffer_error = AVERROR(EIO);
+        goto end;
+    }
     while(1) {
         int len;
 



More information about the ffmpeg-cvslog mailing list