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

Friendly Automation asteriskteam at digium.com
Fri Sep 25 08:20:55 CDT 2020


Friendly Automation has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/14936 )

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
  Friendly Automation: Approved for Submit



diff --git a/main/dsp.c b/main/dsp.c
index e3e1924..89140ab 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/+/14936
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Change-Id: Ib1ce8fc1a8752751f5bf3615c59245532dfd9aa2
Gerrit-Change-Number: 14936
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/4baf834e/attachment.html>


More information about the asterisk-code-review mailing list