]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[spandsp] scan-build: Division by zero - test_cadence() 306/head
authorDragos Oancea <dragos@signalwire.com>
Tue, 4 Feb 2020 14:22:57 +0000 (14:22 +0000)
committerDragos Oancea <dragos@signalwire.com>
Tue, 4 Feb 2020 14:22:57 +0000 (14:22 +0000)
libs/spandsp/src/super_tone_rx.c

index a6324f91bfd0b8391ec6d2fc3c7084a0b6864443..2d54361da1672a27d1d934ff59521b3ffee9c65f 100644 (file)
@@ -170,7 +170,8 @@ static int test_cadence(super_tone_rx_segment_t *pattern,
                 return 0;
             }
         }
-        j = (rotation + steps - 1)%steps;
+        if (steps) 
+            j = (rotation + steps - 1)%steps;
         if (pattern[j].f1 != test[9].f1  ||  pattern[j].f2 != test[9].f2)
             return 0;
         if (pattern[j].max_duration < test[9].min_duration*SUPER_TONE_BINS)