diff options
author | Tom Rini <trini@konsulko.com> | 2022-12-06 10:07:01 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2022-12-06 10:07:01 -0500 |
commit | 14f2d087a3d6347ba0ff7a7e9aaff6955e53e7a8 (patch) | |
tree | bc4677f00c57b7ff42a0852a50d213266896e68a /drivers/sound/sound.c | |
parent | 1c470f32f74248ff4aa145bf033fb6524dc7fc2e (diff) | |
parent | 304bc9f437df51b4d982fe25fd0988350c8f5fc9 (diff) |
Merge tag 'sound-2023-01-rc4' of https://source.denx.de/u-boot/custodians/u-boot-efi
Pull request for sound-2023-01-rc4
* Avoid endless loop and amend unit test
* Add man-page for the sound command
* Fix sandbox sound driver
Diffstat (limited to 'drivers/sound/sound.c')
-rw-r--r-- | drivers/sound/sound.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/sound/sound.c b/drivers/sound/sound.c index 041dfdccfe..c0fc50c99d 100644 --- a/drivers/sound/sound.c +++ b/drivers/sound/sound.c @@ -15,7 +15,10 @@ void sound_create_square_wave(uint sample_rate, unsigned short *data, int size, const int period = freq ? sample_rate / freq : 0; const int half = period / 2; - assert(freq); + if (!half) { + memset(data, 0, size); + return; + } /* Make sure we don't overflow our buffer */ if (size % 2) |