aboutsummaryrefslogtreecommitdiff
path: root/drivers/sound/sound.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/sound/sound.c')
-rw-r--r--drivers/sound/sound.c5
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)