Commit f60b1211 authored by Andriy Gelman's avatar Andriy Gelman Committed by Carl Eugen Hoyos

lavfi/zmq: Avoid mem copy past the end of input buffer

parent 46b97c05
......@@ -139,7 +139,7 @@ static int recv_msg(AVFilterContext *ctx, char **buf, int *buf_size)
ret = AVERROR(ENOMEM);
goto end;
}
memcpy(*buf, zmq_msg_data(&msg), *buf_size);
memcpy(*buf, zmq_msg_data(&msg), *buf_size - 1);
(*buf)[*buf_size-1] = 0;
end:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment