summaryrefslogtreecommitdiffstats
path: root/libavformat/udp.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-11-05 21:21:04 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-11-05 21:21:04 +0100
commit282a6308bfd20e092e470547cf60d3bd6b507314 (patch)
treecc5ca67a6da3f865f8485118a1c3c297ac0dc008 /libavformat/udp.c
parent30d27685b177c055f7540a6c809cf81acb22cc78 (diff)
downloadffmpeg-streaming-282a6308bfd20e092e470547cf60d3bd6b507314.zip
ffmpeg-streaming-282a6308bfd20e092e470547cf60d3bd6b507314.tar.gz
udp: check ff_socket_nonblock() return code
Fixes CID733719 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/udp.c')
-rw-r--r--libavformat/udp.c6
1 files changed, 5 insertions, 1 deletions
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;
OpenPOWER on IntegriCloud