From 282a6308bfd20e092e470547cf60d3bd6b507314 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Mon, 5 Nov 2012 21:21:04 +0100 Subject: [PATCH] udp: check ff_socket_nonblock() return code Fixes CID733719 Signed-off-by: Michael Niedermayer --- libavformat/udp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libavformat/udp.c b/libavformat/udp.c index a88fbe48a5..184ab81884 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;