avformat/libzmq: Check return of zmq_setsockopt

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
pull/343/head
Andriy Gelman 5 years ago committed by Michael Niedermayer
parent f2e7864496
commit 1054b68a62
  1. 9
      libavformat/libzmq.c

@ -123,7 +123,14 @@ static int zmq_proto_open(URLContext *h, const char *uri, int flags)
return AVERROR_EXTERNAL;
}
zmq_setsockopt(s->socket, ZMQ_SUBSCRIBE, "", 0);
ret = zmq_setsockopt(s->socket, ZMQ_SUBSCRIBE, "", 0);
if (ret == -1) {
av_log(h, AV_LOG_ERROR, "Error occured during zmq_setsockopt(): %s\n", ZMQ_STRERROR);
zmq_close(s->socket);
zmq_ctx_term(s->context);
return AVERROR_EXTERNAL;
}
ret = zmq_connect(s->socket, uri);
if (ret == -1) {
av_log(h, AV_LOG_ERROR, "Error occured during zmq_connect(): %s\n", ZMQ_STRERROR);

Loading…
Cancel
Save