[Asterisk-code-review] AST-2019-005 - translate: Don't assume all frames will have a src. (...asterisk[master])

George Joseph asteriskteam at digium.com
Thu Sep 5 07:52:35 CDT 2019


George Joseph has submitted this change and it was merged. ( https://gerrit.asterisk.org/c/asterisk/+/12839 )

Change subject: AST-2019-005 - translate: Don't assume all frames will have a src.
......................................................................

AST-2019-005 - translate: Don't assume all frames will have a src.

This change removes the assumption that a frame will always have
a src set on it. This assumption is incorrect.

Given a scenario where an RTP packet is received with no payload
the resulting audio frame will have no samples. If this frame goes
through a signed linear translation path an interpolated frame can
be created (if generic packet loss concealment is enabled) that has
minimal data on it, including no src. If this frame is given to a
translation path a crash will occur due to the lack of src.

ASTERISK-28499

Change-Id: I024d10dd98207eb8a6b35b59880bcdf1090538f8
---
M main/translate.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  George Joseph: Looks good to me, approved; Approved for Submit



diff --git a/main/translate.c b/main/translate.c
index fe46460..5542107 100644
--- a/main/translate.c
+++ b/main/translate.c
@@ -403,7 +403,7 @@
 
 	if (f->samples == 0) {
 		/* Do not log empty audio frame */
-		if (strcasecmp(f->src, "ast_prod")) {
+		if (!f->src || strcasecmp(f->src, "ast_prod")) {
 			ast_log(LOG_WARNING, "no samples for %s\n", pvt->t->name);
 		}
 	}

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/12839
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: I024d10dd98207eb8a6b35b59880bcdf1090538f8
Gerrit-Change-Number: 12839
Gerrit-PatchSet: 1
Gerrit-Owner: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190905/37e402a2/attachment-0001.html>


More information about the asterisk-code-review mailing list