From: Corey Farrell Date: Tue, 7 Nov 2017 17:49:35 +0000 (-0500) Subject: bridge_softmix: Note why ast_stream_topology_set_stream cannot fail. X-Git-Tag: 16.0.0-rc1~654^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=05f557820bd4c9aec3d148b8d1f1909386fb11da;p=thirdparty%2Fasterisk.git bridge_softmix: Note why ast_stream_topology_set_stream cannot fail. This appeared in my audit of ast_stream_topology_set_stream callers not checking for errors but in this situation the call cannot fail. Add comment so this can be ignored in the future. Change-Id: I91d25704859efbe50b8b82cfe1cd3c40ba177c9f --- diff --git a/bridges/bridge_softmix.c b/bridges/bridge_softmix.c index f490967e2a..8de88f257c 100644 --- a/bridges/bridge_softmix.c +++ b/bridges/bridge_softmix.c @@ -541,6 +541,8 @@ static int append_all_streams(struct ast_stream_topology *dest, dest_index++; if (ast_stream_get_state(stream) == AST_STREAM_STATE_REMOVED) { + /* This cannot fail because dest_index - 1 is less than the + * current count in dest. */ ast_stream_topology_set_stream(dest, dest_index - 1, clone); added = 1; break;