[FFmpeg-cvslog] tools/zmqsend: use valid NULL log context

Stefano Sabatini git at videolan.org
Mon Dec 23 18:45:41 CET 2013


ffmpeg | branch: master | Stefano Sabatini <stefasab at gmail.com> | Mon Dec 23 18:41:58 2013 +0100| [dd00f9cac373be1d184e5d11f3506a90cf4fb983] | committer: Stefano Sabatini

tools/zmqsend: use valid NULL log context

The zmq context is not a valid log context. Fix crash.

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

 tools/zmqsend.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/zmqsend.c b/tools/zmqsend.c
index ae3c8d7..0a1adf0 100644
--- a/tools/zmqsend.c
+++ b/tools/zmqsend.c
@@ -97,14 +97,14 @@ int main(int argc, char **argv)
 
     socket = zmq_socket(ctx, ZMQ_REQ);
     if (!socket) {
-        av_log(ctx, AV_LOG_ERROR,
+        av_log(NULL, AV_LOG_ERROR,
                "Could not create ZMQ socket: %s\n", zmq_strerror(errno));
         ret = 1;
         goto end;
     }
 
     if (zmq_connect(socket, bind_address) == -1) {
-        av_log(ctx, AV_LOG_ERROR, "Could not bind ZMQ responder to address '%s': %s\n",
+        av_log(NULL, AV_LOG_ERROR, "Could not bind ZMQ responder to address '%s': %s\n",
                bind_address, zmq_strerror(errno));
         ret = 1;
         goto end;
@@ -131,14 +131,14 @@ int main(int argc, char **argv)
     }
 
     if (zmq_msg_init(&msg) == -1) {
-        av_log(ctx, AV_LOG_ERROR,
+        av_log(NULL, AV_LOG_ERROR,
                "Could not initialize receiving message: %s\n", zmq_strerror(errno));
         ret = 1;
         goto end;
     }
 
     if (zmq_msg_recv(&msg, socket, 0) == -1) {
-        av_log(ctx, AV_LOG_ERROR,
+        av_log(NULL, AV_LOG_ERROR,
                "Could not receive message: %s\n", zmq_strerror(errno));
         zmq_msg_close(&msg);
         ret = 1;
@@ -148,7 +148,7 @@ int main(int argc, char **argv)
     recv_buf_size = zmq_msg_size(&msg) + 1;
     recv_buf = av_malloc(recv_buf_size);
     if (!recv_buf) {
-        av_log(ctx, AV_LOG_ERROR,
+        av_log(NULL, AV_LOG_ERROR,
                "Could not allocate receiving message buffer\n");
         zmq_msg_close(&msg);
         ret = 1;



More information about the ffmpeg-cvslog mailing list