[PATCH] osmo-trx[master]: sigProcLib: Check return status on downsampling

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Tom Tsou gerrit-no-reply at lists.osmocom.org
Tue Mar 28 22:24:41 UTC 2017


Review at  https://gerrit.osmocom.org/2172

sigProcLib: Check return status on downsampling

Improper length values will cause the polyphase resampler
rotation to fail. Check return and return NULL on error.

Change-Id: I3ad22f9fd7a20754f589c04258dcca3770474a9b
Fixes: Coverity CID 165235
---
M Transceiver52M/sigProcLib.cpp
1 file changed, 6 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/72/2172/1

diff --git a/Transceiver52M/sigProcLib.cpp b/Transceiver52M/sigProcLib.cpp
index 9673d99..4bb41a9 100644
--- a/Transceiver52M/sigProcLib.cpp
+++ b/Transceiver52M/sigProcLib.cpp
@@ -1962,8 +1962,12 @@
   out = new signalVector(DOWNSAMPLE_OUT_LEN);
   memcpy(in->begin(), burst.begin(), DOWNSAMPLE_IN_LEN * 2 * sizeof(float));
 
-  dnsampler->rotate((float *) in->begin(), DOWNSAMPLE_IN_LEN,
-                    (float *) out->begin(), DOWNSAMPLE_OUT_LEN);
+  if (dnsampler->rotate((float *) in->begin(), DOWNSAMPLE_IN_LEN,
+                        (float *) out->begin(), DOWNSAMPLE_OUT_LEN) < 0) {
+    delete out;
+    out = NULL;
+  }
+
   delete in;
   return out;
 };

-- 
To view, visit https://gerrit.osmocom.org/2172
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3ad22f9fd7a20754f589c04258dcca3770474a9b
Gerrit-PatchSet: 1
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Tom Tsou <tom at tsou.cc>



More information about the gerrit-log mailing list