[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]);
|
energy += abs(data[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
agc->score = energy / samples * channels;
|
if (samples) {
|
||||||
|
agc->score = energy / samples * channels;
|
||||||
|
}
|
||||||
agc->score_sum += agc->score;
|
agc->score_sum += agc->score;
|
||||||
agc->score_count++;
|
agc->score_count++;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue