Browse Source

udp: check ff_socket_nonblock() return code

Fixes CID733719
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n1.1
Michael Niedermayer 13 years ago
parent
commit
282a6308bf
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      libavformat/udp.c

+ 5
- 1
libavformat/udp.c View File

@@ -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;



Loading…
Cancel
Save