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

Sean Bright asteriskteam at digium.com
Wed Sep 23 15:21:03 CDT 2020


Sean Bright has uploaded this change for review. ( 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(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/36/14936/1

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-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20200923/1201fd4f/attachment.html>


More information about the asterisk-code-review mailing list