dreamsourcelab-dslogic: avoid division by zero

Do not align to block_size when its value is zero.

This was reported by clang's scan-build.
This commit is contained in:
Gerhard Sittig 2018-02-08 23:16:40 +01:00 committed by Uwe Hermann
parent 8e2fd23acb
commit 051e4beb79
1 changed files with 2 additions and 0 deletions

View File

@ -914,6 +914,8 @@ static size_t get_buffer_size(const struct sr_dev_inst *sdi)
*/
const size_t block_size = enabled_channel_count(sdi) * 512;
const size_t s = 10 * to_bytes_per_ms(sdi);
if (!block_size)
return s;
return ((s + block_size - 1) / block_size) * block_size;
}