[Asterisk-code-review] dsp.c: Update calls to ast_format_cmp to check result properly (asterisk[17])

George Joseph asteriskteam at digium.com
Fri Sep 25 08:36:11 CDT 2020


George Joseph has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/14988 )

Change subject: dsp.c: Update calls to ast_format_cmp to check result properly
......................................................................

dsp.c: Update calls to ast_format_cmp to check result properly

ASTERISK-28311 #close

Change-Id: Ib1ce8fc1a8752751f5bf3615c59245532dfd9aa2
---
M main/dsp.c
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/main/dsp.c b/main/dsp.c
index 433e61a..871a687 100644
--- a/main/dsp.c
+++ b/main/dsp.c
@@ -1442,12 +1442,12 @@
 	} else {
 		odata = f->data.ptr;
 		len = f->datalen;
-		if (ast_format_cmp(f->subclass.format, ast_format_ulaw)) {
+		if (ast_format_cmp(f->subclass.format, ast_format_ulaw) == AST_FORMAT_CMP_EQUAL) {
 			s = ast_alloca(len * 2);
 			for (x = 0; x < len; x++) {
 				s[x] = AST_MULAW(odata[x]);
 			}
-		} else if (ast_format_cmp(f->subclass.format, ast_format_alaw)) {
+		} else if (ast_format_cmp(f->subclass.format, ast_format_alaw) == AST_FORMAT_CMP_EQUAL) {
 			s = ast_alloca(len * 2);
 			for (x = 0; x < len; x++) {
 				s[x] = AST_ALAW(odata[x]);

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

Gerrit-Project: asterisk
Gerrit-Branch: 17
Gerrit-Change-Id: Ib1ce8fc1a8752751f5bf3615c59245532dfd9aa2
Gerrit-Change-Number: 14988
Gerrit-PatchSet: 1
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20200925/2d51972c/attachment.html>


More information about the asterisk-code-review mailing list