Fix divide-by-zero when result_len is zero

This commit is contained in:
Ryan Drake
2026-10-19 10:37:10 -07:00
parent be57b5149b
commit 6106a608e3

View File

@@ -454,6 +454,9 @@ void dc_block_filter(struct demod_state *fm)
{
int i, avg;
int64_t sum = 0;
if (fm->result_len == 0) {
return;
}
for (i=0; i < fm->result_len; i++) {
sum += fm->result[i];
}