[Asterisk-code-review] bridge softmix: Note why ast stream topology set stream cann... (asterisk[15])

Joshua Colp asteriskteam at digium.com
Thu Nov 9 03:43:00 CST 2017


Joshua Colp has submitted this change and it was merged. ( https://gerrit.asterisk.org/7106 )

Change subject: bridge_softmix: Note why ast_stream_topology_set_stream cannot fail.
......................................................................

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
---
M bridges/bridge_softmix.c
1 file changed, 2 insertions(+), 0 deletions(-)

Approvals:
  Richard Mudgett: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved; Approved for Submit



diff --git a/bridges/bridge_softmix.c b/bridges/bridge_softmix.c
index f490967..8de88f2 100644
--- a/bridges/bridge_softmix.c
+++ b/bridges/bridge_softmix.c
@@ -541,6 +541,8 @@
 			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;

-- 
To view, visit https://gerrit.asterisk.org/7106
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 15
Gerrit-MessageType: merged
Gerrit-Change-Id: I91d25704859efbe50b8b82cfe1cd3c40ba177c9f
Gerrit-Change-Number: 7106
Gerrit-PatchSet: 2
Gerrit-Owner: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20171109/8e77f541/attachment-0001.html>


More information about the asterisk-code-review mailing list