mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-03-13 12:40:17 +00:00
[core] scan-build: switch_agc_feed() - Division by zero
This commit is contained in:
parent
3d52d2a9ca
commit
51bf0fc51a
@ -522,7 +522,9 @@ SWITCH_DECLARE(switch_status_t) switch_agc_feed(switch_agc_t *agc, int16_t *data
|
||||
energy += abs(data[i]);
|
||||
}
|
||||
|
||||
agc->score = energy / samples * channels;
|
||||
if (samples) {
|
||||
agc->score = energy / samples * channels;
|
||||
}
|
||||
agc->score_sum += agc->score;
|
||||
agc->score_count++;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user